1. Would this do the trick to free all the memory?
Code:
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)

Last edited by Carlos3DGS; 02/05/13 20:16.

"The more you know, the more you realize how little you know..."

I <3 HORUS
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=401929&page=1