Question:
can some explain C++ endl;?
saqib
2010-03-22 09:31:18 UTC
i am new to programming and C++, can some one plz explain what does this mean"endl flushes the buffer". i know that endl is used for carraige return but what does "flushes buffer" mean...
Four answers:
tbshmkr
2010-03-22 11:34:00 UTC
flush == written out to the physical output device

=

The endl manipulator give you a simple way to flush an output stream.
Easy Peasy
2010-03-22 09:57:21 UTC
Data streams are often handled in fixed size blocks, data does not always come in convenient sizes.



Example:

say your block transfer size is 5 and your data is 13 in length then the first two blocks of 5 would be transferred but the last three would remain in the buffer waiting for 2 more. As the end of the data has been reached the endl tells the system to process these remaining 3 without waiting for more.
2010-03-22 09:33:51 UTC
It forces the program to output everything in the output buffer. (Output is placed into a buffer - characters aren't sent out the instant that part of the code is executed - that would slow things down considerably.)
freedman
2016-10-06 03:04:28 UTC
it rather is an rather common piece of software it rather is going to coach a menu reveal like; ::::::::: scholar administration equipment:::::::::: significant MENU [a million] >>>> upload checklist Of scholar [2] >>>> seek checklist Of scholar [3] >>>> Edit checklist Of scholar [4] >>>> go out software enter your determination from a million to 5 ? here you want to go right into a character in accordance to that character this equipment will proceed ; t - tab endl - newline


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...