Return value EOF of scanf in C -


scanf in c language, little confused return value.

in instruction, says:

  1. eof returned if end of input reached before either first successful conversion or matching failure occurs.
  2. eof returned if read error occurs, in case error indicator stream set.

first, not sure mean if end of input reached before first successful conversion or before matching failure occurs. how possible?

second, not sure difference between read error , matching failure?

first, not sure mean if end of input reached before first successful conversion or before matching failure occurs. how possible?

imagine you're trying read character file , you're @ end of file. end of input reached before successful conversion or matching attempt takes place.

second, not sure difference between read error , matching failure?

a read error means unable read data file. matching failure means able read data didn't match expected (for example, reading a %d.)


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -