Release memory using 'delete' operator for 2 dimensional array
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I want to release memory for int a[4][6] which is allocated dynamically. I m allocating this memory as for(int i = 0;i<4; i++) { a[i] = new int [6]; } And deallocating it as for(int j = 0; j<4; j++) { delete []a[i]; } Is the way of allocating & deallocating memory is right or not? Thanks in advance. Regards Nikesh