Mega Code Archive

 
Categories / C++ Tutorial / Development
 

EndLine manipulator (using escape sequence n and member function flush)

#include <iostream> using std::ostream; using std::cout; using std::flush; ostream& endLine( ostream& output ) {    return output << '\n' << flush; // issue endl-like end of line } int main() {    cout << "-----" << endLine;    return 0; } -----