Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
std::flush is a stream manipulator to display the content of the stream. Normally, a stream can wait until a good moment (the end of the program, for example), std::flush enforces a direct output. std::cout is a stream that one might want to flush, std::clog and std::cerr always flush. When writing '\n' to std::cout, std::cout is not flushed, std::endl writes '\n' and flushes the stream. Note that flushing a stream takes time, so only flush when needed.
#include <iostream> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.