B
baumann@pan
hi all,
when fflush function must be called? and why?
thanks
baumann@pan
when fflush function must be called? and why?
thanks
baumann@pan
hi all,
when fflush function must be called? and why?
thanks
baumann@pan
baumann@pan said:hi all,
when fflush function must be called? and why?
thanks
baumann@pan
when fflush function must be called? and why?
no, i just wonderMark said:When you want to flush output.
Because you want to flush output.
( This is a homework question, right? )
Jack said:fflush(), or a file positioning function, must be called after writing
to a file opened in append mode before reading from the file. But the
fseek() or fsetpos() could be used as well, and indeed must be used
after reading from a file opened in append mode before writing to it.
There is no situation where the fflush() function must be called at
all.
There are cases where it is advisable to do so. The most particular
one is if a prompt that does not end in a '\n' is sent to the standard
output prompting for user input. On some systems, the prompt may not
appear on the terminal or display until after the user ends his input
with the 'enter' or 'return' key, unless you fflush() stdout before
calling the input function on stdin.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.