www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/07/14/23:57:30

Date: Wed, 14 Jul 93 21:11:34 MDT
From: gunter AT statsun DOT stat DOT ColoState DOT EDU (Gunter Hartel)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: rewind()

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019