std::endl Inserts a newline character into the output sequence (os) and flushes it... ... In most (other) usual interactive I/O scenarios, std::endl is redundant when used with std::cout because any input from std::cin, output to std::cerr, or program termination forces a call to std::cout.flush(). Use of std::endl in place of '\n', encouraged by some sources, may significantly degrade output performance. ... The code samples on this wiki follow Bjarne Stroustrup and The C++ Core Guidelines in flushing the standard output only where necessary. http://en.cppreference.com/w/cpp/io/manip/endl |