I am new to c++, learning through Accelerated C++ by Andrew Koenig and Barbara E. Moo.
I am unable to grasp the concept of buffer in C++ as the book says "Most systems take a significant amount of time to write characters to an output device, regardless of how many characters there are to write. 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."
Why do most systems take a significant amount of time to write characters to an output device? What is this buffer and why do we require it?Why do we require flushing buffers?