473,386 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

endl = " \n " ?

is it true or not ?

Jun 28 '06 #1
6 5102
asdf wrote:
is it true or not ?


Not.

Jun 28 '06 #2
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
So, what's the difference?
thanks.

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


Not.


Jun 28 '06 #4
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ensoul Chee | last post by:
I used #include <iostream.h> int m; cout << "Hexadecimal == 0x" << hex << m << endl; to print value of m in hexadecimal mode. But I got the compile error like this couttest.cpp:20 `hex'...
9
by: dover | last post by:
For the code, outputfile << *p << endl; Someone suggests: Don't use endl here; it is flushing output stream every time. Use plain '\n'. What's the difference of using "endl" and "\n" above?...
1
by: Kashish | last post by:
Is file<<"Some string"<<endl is an atomic operation. where file is an ofstream object. If we output a string in ofstream and we provide endl after that,Can we make sure the whole string will be...
12
by: Filipe Sousa | last post by:
Hi! Could someone explain to me why this operation is not what I was expecting? int main() { int x = 2; std::cout << x << " " << x++ << std::endl; return 0; }
9
by: Xian | last post by:
Is there a right and proper (tm) way to end a line? Thinking about portability and the mess that the 'wrong' line endings can cause. E.g. std::cout << "Hello World!\n"; or std::cout << "Hello...
9
by: andrew.smith.cpp | last post by:
hi, whts the difference between the std::endl or "\n" ? because both do the same work Thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.