page fault when call free()
Posted on 1998-09-25
I am using MSVC 5.0 and it is a Win32 console application. My program always got a page fault when it runs a while. After tracing the error, I finally find that it occurs when I call free(). However, this is very strange because this free() call is within a loop. It looks like this:
free(myPointer[i]); // error occurs when i=18
The error occured when i = 18! I have checked myPointer's dimension and I am sure memory was successfully allocated to it. I would like to know what is the probable cause for this problem, or is it a bug of VC?
Any help is appreciated.