iostream hierarchy endl |
cplusplus.com |
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.
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