Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C++
Expertise: Beginner
Aug 18, 2000

Rewinding a File

Instead of using the following form to rewind a file:

 
fseek (fstream, 0, SEEK_SET);

You can use the standard function rewind() as a shorthand. rewind() is declared in <stdio.h> as follows:

 
void rewind (FILE *);

Rewind() has the same effect of the fseek() call above, namely, setting the file pointer to the file's beginning:

 
rewind(fstream);
Danny Kalev
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap