A
andrew.smith.cpp
hi,
whts the difference between the std::endl or "\n" ?
because both do the same work
Thanks
whts the difference between the std::endl or "\n" ?
because both do the same work
Thanks
hi,
whts the difference between the std::endl or "\n" ?
because both do the same work
Thanks
Not all differences are visible. The difference is that std::endl
flushes the stream's buffer and \n doesn't.
Also \n is a character and I think std::endl is a function. (Not 100%
sure of my 2nd assertion but very sure of my first.)
Paul Epstein
Not all differences are visible. The difference is that std::endl
flushes the stream's buffer and \n doesn't.
Also \n is a character and I think std::endl is a function. (Not 100%
sure of my 2nd assertion but very sure of my first.)
whts the difference between the std::endl or "\n" ?
because both do the same work
On Mar 29, 12:48 pm, (e-mail address removed) wrote:
Not all differences are visible. The difference is that std::endl
flushes the stream's buffer and \n doesn't.
What are the advantages of flushing the stream buffer?? Does it mean
that the ocasional '\n' from input will be discarded or am i missing
something?
What are the advantages of flushing the stream buffer?? Does it mean
that the ocasional '\n' from input will be discarded or am i missing
something?
André Castelo said:What are the advantages of flushing the stream buffer?? Does it mean
that the ocasional '\n' from input will be discarded or am i missing
something?
André Castelo said:What are the advantages of flushing the stream buffer?? Does it mean
that the ocasional '\n' from input will be discarded or am i missing
something?
What are the advantages of flushing the stream buffer?? Does
it mean that the ocasional '\n' from input will be discarded
or am i missing something?
On 2008-03-29 15:03, André Castelo wrote:
When you flush the stream buffer its contents is written to
the file/ console associated with it. Should something happen
to your program before the buffers are flushed it is possible
that the contents in the buffers is lost (i.e. not written to
file).
James said:The data isn't actually output until you flush the buffer.
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.