https://www.cplusplus.com/doc/tutorial/basic_io/
In the following site, just before cin heading, it is stated that
The endl manipulator produces a newline character, exactly as the insertion of '\n' does; but it also has an additional behavior: the stream's buffer (if any) is flushed, which means that the output is requested to be physically written to the device, if it wasn't already. This affects mainly fully buffered streams, and cout is (generally) not a fully buffered stream.
My questions are, why endl mainly affects the fully buffered streams, and how cout is not a fully buffered stream?
Aucun commentaire:
Enregistrer un commentaire