2 D dynamic arrays | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

2 D dynamic arrays

Is it ok if we do not have any values for the rows and columns in a 2 D dynamic array from the point of view of memory allocation

23rd Apr 2019, 2:17 PM
Sanjay Kamath
Sanjay Kamath - avatar
1 Answer
I do think it’s fine, even if you access the unitialized value, it might contains random value. My tip here is, after allocating the memory, initialize the default value.
24th Apr 2019, 1:26 AM
Owenizedd - avatar