By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,221 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

endl = " \n " ?

P: n/a
is it true or not ?

Jun 28 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
asdf wrote:
is it true or not ?


Not.

Jun 28 '06 #2

P: n/a
asdf wrote:
is it true or not ?


endl is outputting '\n' followed by a flush.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 28 '06 #3

P: n/a
So, what's the difference?
thanks.

Rolf Magnus wrote:
asdf wrote:
is it true or not ?


Not.


Jun 28 '06 #4

P: n/a
asdf wrote:
is it true or not ?


Could you do this newsgroup and your boss a major favor? Buy a name-brand
C++ book, such as /The C++ Language, 3rd ed/ by Stroustrup, take it home,
and just sit around reading it for a while.

I promise it won't be as painful as, say, an OMG specification. And your
velocity with your boss and with this group would then be much faster. You
are currently just muddling your way through.

In this specific case, endl inserts a "\n" into the output stream, and
then it flushes that stream, so its buffered data will at least go
outside the current process. OSs typically respond by printing such data
to a console.

Did that help? Or are you reading code where someone used endl while
writing to a file, where flushes behave different?

--
Phlip
Jun 28 '06 #5

P: n/a
thanks for your helpful advice.
Phlip wrote:
asdf wrote:
is it true or not ?


Could you do this newsgroup and your boss a major favor? Buy a name-brand
C++ book, such as /The C++ Language, 3rd ed/ by Stroustrup, take it home,
and just sit around reading it for a while.

I promise it won't be as painful as, say, an OMG specification. And your
velocity with your boss and with this group would then be much faster. You
are currently just muddling your way through.

In this specific case, endl inserts a "\n" into the output stream, and
then it flushes that stream, so its buffered data will at least go
outside the current process. OSs typically respond by printing such data
to a console.

Did that help? Or are you reading code where someone used endl while
writing to a file, where flushes behave different?

--
Phlip


Jun 28 '06 #6

P: n/a
asdf wrote:
So, what's the difference?
thanks.


Please don't top-post. See item four in the FAQ below:

<http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.4>


Brian
Jun 28 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.