Thread: Help
View Single Post
Old Apr 5th, 2006, 12:14 PM   #12
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
I've had problems with printf writing to the screen and not flushing afterwards.
Quote:
The function fflush forces a write of all buffered data
for the given output or update stream via the stream's
underlying write function. The open status of the stream
is unaffected.
If printf "wrote to the screen" the contents written aren't there to flush. Unwritten contents might be. If your system wrote to the output device and the data remained in the buffer (well, the pointer didn't reflect the output), then you have a fairly serious failure. This would be unlikely on a normal, off-the-shelf system such as most people deal with. I would suggest you garner as much information as possible by examining the file pointer structure if you find this to be a real problem.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote