Now that I am home I have been looking at the code more carefully but I have a couple of questions.
1. Would a simple "free(Bwater);" be enough to free the memory used by the whole 1000X500 array? Or would I have to use multiple free() instructions inside a loop like when you malloc()?
2. I dont understand what you are doing in this instruction:
"memset( Bwater[j] , (int)100 , (int)500 * sizeof(int) );"
Are you setting the whole column to 100 as if it were one huge number? I am lost with this part