C: Correctly freeing memory of a multi-dimensional array
OK, there’s a fair deal of confusion explaining exactly what order the necessary free() calls have to be in, so I’ll try to clarify what people are trying to get at and why. Starting with the basics, to free up memory which has been allocated using malloc(), you simply call free() with exactly the pointer … Read more