fscanf & EOF

J Gillespie james at castle.ed.ac.uk
Wed Feb 20 10:43:48 AEST 1991


gls at novavax.UUCP (Gary Schaps) writes:

>Would some kind soul care to illuminate for me why this code dumps core?

>	 while ( (fscanf(input,"%8s%1s%2s", part_number, delimiter, 
>		  part_class)) && (feof(input)) ) 

Should that be feof(input), or !feof(input) ?
                               ^^^^^

-- 
  James Gillespie,     /~~~~~~~~\
 Edinburgh University /   @  @   \ "Oh wow.  What a bummer."
   james at ed.ac.uk    /     <      \		-- Truman Sparks, _Fandango_
____________________/  \________/  \__________________________________________



More information about the Comp.lang.c mailing list