fscanf & EOF

Jeff Newberry newberry at nmsu.edu
Tue Feb 12 05:47:03 AEST 1991


>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)) ) 


How are the arguments defined?  If they are all defined as arrays of
characters, then I don't know why it core dumps.  If "delimiter" is
defined as a charater, then you need "&delimiter".

Also, I assume you want to put (!feof(input))?

I hope this helps.

Jeff Newberry
newberry%nmsu.edu



More information about the Comp.lang.c mailing list