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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: C++
Expertise: Beginner
Dec 4, 1998

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


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
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date