|
From: Ioannis V. <no...@ya...> - 2001-09-03 23:12:39
|
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On Behalf
> Of Michael C
> Sent: Monday, September 03, 2001 10:37 PM
> To: dev...@li...
> Subject: Re: [Dev-C++] how to use strings
> 3) fprintf() and fscanf() do not move the file position and I
> can't remember how to do this. So another call to fprintf()
Of course they do. There are thousands of many ways to move the file
position, fseek(), fread(), ....
> will not read the stringified number on the next line. I
> thought I could use:
> 'fseek (fhandle, len, SEEK_CUR);' where len is the
> returned value from a successful call to fprintf()
The strategy is a mistake.
> However, this doesn't work. Instead I prefer to use:
>
> int c;
> while ((c = fgetc (fhandle)) != EOF)
> {
> fputc (c, stdout);
> }
>
This works too.
> Any comments?
>
> Hope this helps.
>
> Michael
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
|