0

Why endl,endl,endl use 3times in a code??

C++ https://www.sololearn.com/discuss/3082523/?ref=app

11th Sep 2022, 2:47 PM
Abubakar Saidu
Abubakar Saidu - avatar
3 Answers
+ 3
You can use endl as often as you like. Go to Code section, click +, select C++, create an example code. You will see that each endl is one linebreak. Please ONLY LINK THREADS THAT ARE RELATED TO YOUR QUESTION.
11th Sep 2022, 3:00 PM
Lisa
Lisa - avatar
+ 3
You have linked a SQL question. Please correct the link. In C++ endl outputs a newline and then flushes the output buffer to the stream. Flushing the buffer causes it to print immediately instead of waiting until the output buffer fills up. It is a little wasteful to perform endl three times. The intent would be to make extra blank lines in the output, but there is no need to flush every newline. It would be more efficient to send two newlines ("\n\n") and one endl.
11th Sep 2022, 3:05 PM
Brian
Brian - avatar
+ 1
Where ? Anywhere... For 3 line breaks.. if you need.. endl means end line
11th Sep 2022, 3:00 PM
Jayakrishna šŸ‡®šŸ‡³