Mail Archives: djgpp/1993/07/15/15:59:35
Hello
Would someone try out the rewind() function for me. The following segment
will read the file 'junk' only once under djgpp but twice under MSC and UNIX
(Sparcstation). I'd like to be sure that I didn't make a mistake in the
installation.
I'm not too familiar with ANSI C and know nothing about C++ but the code seems
to match my ANSI C manual. I would appreciate any help on this.
Thanks muchly
Gunter
My compile command is:
gcc -m486 -lm -lc -lpc test.c
The program is:
#include <stdio.h>
FILE *input;
float temp;
main()
{
printf("EOF = %d\n",EOF);
input = fopen( "junk", "r");
while (fscanf(input,"%f \n",&temp)!=EOF) {printf("ONE %f \n",temp);}
rewind(input);
while (fscanf(input,"%f \n",&temp)!=EOF) {printf("TWO %f \n",temp);}
}
- Raw text -