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??

14th Jun 2018, 8:10 PM
RandomCreator
RandomCreator - avatar
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;
14th Jun 2018, 9:04 PM
MO ELomari
MO ELomari - avatar
0
thanks
23rd Jun 2018, 6:09 PM
RandomCreator
RandomCreator - avatar