dynamic memory - arrays | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

dynamic memory - arrays

int *p = NULL; // Pointer initialized with null p = new int[]; // Request memory delete [] p; // Delete array pointed to by p is this correct? (not declared array length)

16th May 2020, 6:48 PM
Kumudu_Mohottala
Kumudu_Mohottala - avatar
1 Answer
+ 2
You must specify length.
16th May 2020, 7:24 PM
Mustafa K.
Mustafa K. - avatar