Export (0) Print
Expand All

endl

Terminates a line and flushes the buffer.

template class<_Elem, _Tr>
   basic_ostream<_Elem, _Tr>& endl( 
      basic_ostream<_Elem, _Tr>& _Ostr 
   );

_Elem

The element type.

_Ostr

An object of type basic_ostream.

_Tr

Character traits.

An object of type basic_ostream.

The manipulator calls _Ostr.put(_Ostr. widen('\n')), and then calls _Ostr.flush. It returns _Ostr.

// ostream_endl.cpp
// compile with: /EHsc
#include <iostream>

int main( ) 
{
   using namespace std;
   cout << "testing" << endl;
}
testing

Header: <ostream>

Namespace: std

Show:
© 2014 Microsoft