Mail Archives: djgpp/1993/07/14/23:57:30
Heloo
Does the rewind() function in stdio work properly? The following piece
works under MS but fails to reset the file pointer under DJGPP. Am I taking
something for granted somewhere?
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);}
}
Any help is appreciated. Until then I'll just close and reopen.
Gunter
- Raw text -