iostream hierarchy
endl
  cplusplus.com  
stream manipulator
ostream&  endl ( ostream& os );

Insert newline and flush.
  Insert a new-line character in the stream and if the stream is a buffered stream then flushes (see flush) it.

Parameters.

os
Stream in which the insertion has to be performed.
This is a manipulator parameter that is automatically assumed if used with insertion operator (operator<<).

Return Value.
  A reference to the stream object (parameter os).

Example.

// endl
#include <iostream>
using namespace std;

int main () {

  int ival=100;
  float fval=3.14;

  cout << ival;
  cout << endl;
  cout << fval;
  endl (cout);


  return 0;
}
  This example demonstrates two ways of calling a manipulator. Both are valid:
  cout << endl;
  endl (cout);

Basic template declaration:
template <class charT, class traits>
  basic_ostream<charT,traits>& endl ( basic_ostream<charT,traits>& os );

See also.
  ostream class


© The C++ Resources Network, 2001