Ask your own question, for FREE!
Computer Science 4 Online
OpenStudy (anonymous):

use of fflush()?

OpenStudy (rsmith6559):

When you "write" to a file, you actually write to a buffer. The OS decides when to actually write the data to disk. This can normally up to 5 seconds later. This allows the OS to gather data and organize it for optimal disk access, which is about 1000 times slower than memory access. Normally, this is fine. Occasionally, you want the data flushed to disk immediately, even if it slows down your program, so you use fflush() (File FLUSH). I believe that it needs the output file as an argument.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!