1. Would this do the trick to free all the memory?
void remove_array()
{
//REMOVE THE DATA
//free the data (integers)
for(tx=0;tx<1000;tx++)
{
for(ty=0;ty<500;ty++)
{
free((Bwater[tx])[ty]);
}
}
//REMOVE THE POINTERS
//free the colums
for (ty=0;ty<1000;ty++)
{
free(Bwater[j]);
}
//free the rows
free(Bwater);
}
2. Does that mean that I would not need the memset() instruction at all if I want the array to start off as full of zeros? (I want to make sure I understood correctly. I don't want to end up with a huge array of pointers pointing to nothing)