It's not impossible.
Here I have an array of 500,000 elements, arr1. I have an array of pointers, arr2.
-----
char arr1[500000],
**arr2;
... //populate arr1
arr2 = new char * [500000];
for (int i = 0; i < 500000; i++)
arr2[i] = &arr1[i];
-----
That does what I want. That...
Well, I think I'm pretty dumb. I realized what I was doing wrong.
Rather than "char *arr;" for my array, I should have been created a doubple pointer "char **arr;" instead.
Thanks.
-Jon
I'm new to programming with C++, so this is fairly confusing. I'm trying to make an array of pointers, and it's not going real well.
I have an array of characters around 500,000 elements in size. I'm trying to make an array of pointers that then points to each of those different elements...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.