Click to See Complete Forum and Search --> : Assertion Failure in fscanf


Ivy
April 17th, 1999, 06:38 PM
I'm trying to read an input file into my program so I can manipulate the data and display it in the output. When I run my program, I get an assertion failure message that reads "Expression: Stream !=NULL". The error occurs after attempting to read the fscanf command that is storing the data in a user defined data structure array. What does this mean? Any advice on how to debug or correct?

April 19th, 1999, 07:40 AM
What it means is that the 1st argument (the FILE* for the file you are trying to read) is NULL. Perhaps your fopen failed? I suggest you step through the code that handles the file. Check that fopen returns a non-NULL value, and check that nothing resets the variable that holds the FILE* returned by fopen.