new pointers?
Can I use new to create an array of pointers, then later each pointer will point to an array of objects. For example;
int * Pointer;
Pointer = new int*[50];
// Above, I want to make an array of pointers dynamically, not objects yet.
Pointer[0] = new int[5];
// TRhe above should make the objects, the address stored in Pointer[0]
I tried the above and it doesn''t work right, but it is an example of what I want to do. Does someone know how to do this (or what I am trying to do). Thanks for any help!
September 10, 2000 11:02 AM
int** ArrayOfPointers;
ArrayOfPointers = new int*[50];
...
delete [] ArrayOfPointers;
ArrayOfPointers = new int*[50];
...
delete [] ArrayOfPointers;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement