what does it mean "flushing the stream"

i read in some book this "Note that \n is not quite the same as endl. endl will output a newline and flush the stream, while
\n will output the newline without flushing the stream."

what does it mean "flushing the stream"?
closed account (zb0S216C)
It means forcing the contents of the output stream to the default output medium the OS uses (the console on Windows and the terminal on *nix). A stream is a buffer used to store I/O data. For instance, "std::cin" has a buffer to store input data whereas "std::cout's" buffer is used to store data that's going to be sent to screen.

In certain points in a program, the output stream is automatically flushed; flushing is not always necessary.

Wazzak
Last edited on
thank Framework

that explained it.
Topic archived. No new replies allowed.