I am trying to create a array of pointers dynamically. From what I have read until now this can be done in the following way in C++
CPoint** data_temp;
data_temp = new CPoint*[an_integer];
I am later going to add pointers to this array which will be pointing to an object. Some what like this, using a for
loop
CPoint A;
CPoint* data = &A; //I am using just a single value but data will also be an array
*data_temp[i] = data; // where data is pointer address
Now the question is if to free up memory I delete the pointer array data_temp
would it also delete the original object i.e. A
?
delete[] data_temp;
I am asking this because I need the object at a later stage.