there is debug assertion failed error. Can someone get to the probem.
Debug Assertion Failed !
Program:..
File:fclose.c
Line:47Expression:(stream!=Null)
I am debugging the code in visual studio.
Here is the Part of the code:
int __cdecl fclose (
FILE *stream
)
{
int result = EOF;
_VALIDATE_RETURN((stream != NULL), EINVAL, EOF);
/* If stream is a string, simply clear flag and return EOF */
if (stream->_flag & _IOSTRG)
stream->_flag = 0; /* IS THIS REALLY NEEDED ??? */
/* Stream is a real file. */
else {
_lock_str(stream);
__try {
result = _fclose_nolock(stream);
}
__finally {
_unlock_str(stream);
}
}
return(result);
}
NULLpointer tofclosewhich is what the assertion is about. Check your code to see why you callfclosewith aNULLpointer, maybe you forgot to check the return fromfopen? - Some programmer dude