so I have a pointer that points to an array of pointers!
int **matrixPtr;
matrixPtr = new int*[5];
for(i=0; i<5; ++i){
matrixPtr[i]= new int[5];
}
I'm wondering if this is the proper way to free up the memory!
for(i=0; i<5; ++i){
delete [] matrixPtr[i];
}
delete [] matrixPtr;
Thanks!
std::arrayorstd::vectorto make your life easier by avoidingnewanddeletealtogether.