Can someone explain the concept of buffers a bit more explicitly? I understand that buffers are data structures where characters are stored, and the place where the data is to be read from. What is the idea of flushing buffers?

When a buffer is flushed, is this referring to the act of writing the characters stored in it?

From the text:

To avoid the overhead of writing in response to each output request, the library uses the 
buffer to accumulate the characters to be written, and flushes the buffer, by writing its
contents to the output device, only when necessary. By doing so, it can combine several 
output operations into a single write.

When referring to 'flushing' that almost makes it sound as if the buffer is being written but also erased at the same time. Just speculation.

So, in order to be wrote to view on a screen the buffer flush is required?

When our program writes its prompt to cout, that output goes into the buffer associated
with the standard output stream. Next, we attempt to read from cin. This read flushes
the cout buffer, so we are assured that our user will see the prompt.

Here, it sounds as if the by using 'endl' at the end it tells the system it needs to write immediately(implying otherwise is wouldn't?) What is endl is not used?

Writing the value of std::endl ends the line of 
output, and then flushes the buffer, which forces the system to write to the output 
stream immediately.
Edit
Report