Why Do We Have To Initialize When We Reserve Memory With Malloc? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why Do We Have To Initialize When We Reserve Memory With Malloc?

https://stackoverflow.com/questions/8740195/how-do-we-allocate-a-2-d-array-using-one-malloc-statement I am trying to understand how to make 2d array with pointers. I found this link. I can't understand fully why do have to initialize each row to its first element. What I also understood from second comment on this link is that he is pointing to array[nrows] from data. After that array[i] take its position as array[nrows] but after this iteration array[i] takes its position as array[nrows+1]?it's not pssible

14th Dec 2017, 7:31 AM
Yusuf
Yusuf - avatar
0 Answers