Creating an Array of pointers

Say if I wanted to make an array point to an array of pointers..


lets call the type TypeOfObject*

so we have

TypeOfObject** arrayOfPointers = NULL;

now how would I go about make another seperate array of pointers and having arrayOfPointers point to that new array, I can declare it but it wont work when I run my program.... :/

thank you for any help



why not by using an extra '*'? TypeOfObject ***p;
After that u may access first value something like ***p or p[0][0][0].
I think this is what he means:
1
2
3
4
TypeOfObject** arrayOfPointers = NULL;

TypeOfObject** someOtherArrayOfPointers = new (TypeOfObject*)[arr_len];
arrayOfPointers = someOtherArrayOfPointers;


Where arrayOfPointers and someOtherArrayOfPointers point to the same thing.
Am I wrong?
Topic archived. No new replies allowed.