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
Dec 4, 1998

fflush()

Question:
I am having difficulty finding information and examples on how to use the flush function.

Answer:
If you are not sure how to use this function, then you probably don't need it. Most C/C++ programs do not need to use this function.

To make file access faster, many run-time library routines will read and write a fixed number of bytes at a time. This means that if you write one byte at a time, the functions will wait until an internal buffer is full and write it all at once, which is considerably faster than going to disk for each byte.

Normally, this is done transparently and there is no reason to flush a file as it is automatically flushed when the file is closed.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


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

 

 

Sitemap