August 2012
Intermediate to advanced
976 pages
30h 17m
English
Each output stream manages a buffer, which it uses to hold the data that the program reads and writes. For example, when the following code is executed
os << "please enter a value: ";
the literal string might be printed immediately, or the operating system might store the data in a buffer to be printed later. Using a buffer allows the operating system to combine several output operations from our program into a single system-level write. Because writing to a device can be time-consuming, letting the operating system combine several output operations into a single write can provide an important performance boost.
There are several conditions that cause the buffer to be flushed—that is, to be written—to the actual ...
Read now
Unlock full access