0
What is the value of an index of an array when not given anything?
if you build - int arr[ ] = new arr [5] and you don't put anything inside does the index 2 (for example) equal to zero??
2 Answers
0
yes, it is
the correct instruction for dynamic memory allocate is:
int* arr = new int[5];
be careful, this allocated block of memory will not be freed until you tell it so by writing
delete [] arr;
0
thanks