View Single Post
Old 04-19-2005, 01:25 AM   #3 (permalink)
lostromos
Registered User
 
Join Date: Apr 2005
Posts: 5
lostromos is on a distinguished road
Valmont, your answer was clear and you have been of great help.

I understand that in my case the following should be done:

Code:
int * VarArray = getArray();   /* VarArray points to the contents of what getArray returns */
const int * MyArray = new int [size]; /* I have to create a new array where i'll stock the VarArray's data. However, since there are no places reserved (as in the case of VarArray) i have to reserve "size" places in memory. I'm also not sure if "const" is ok, but i can check this */
for(int i=0; i<size; i++)
  MyArray[i] = VarArray[i];  /* MyArray will remain like this for ever after */
.............................
delete [] MyArray;
return "Thanks one more Valmont"
George
lostromos is offline   Reply With Quote