In other words, an integer value will be returned in the end, which is certain, but when the data can be read normally, fscanf returns the number of read data, otherwise it returns EOF. EOF is displayed as-1 in a plastic way.
For example:
n = fscanf(f," %d ",I);
Here f refers to a file with no content, and I and n are two integer variables. At this time, I has not been reassigned because the data cannot be read in. If the original I has a value, the value remains the same. If it is not assigned, it will be an arbitrary number. And n is the EOF at this time, that is,-1.