
74 Input and Output in C++
Explanation: In the above program, endl manipulator is used to split the line. The two strings
are displayed on two separate lines.
Explanation: In the above program, the statement flush (cout) flushes the buffer. This statement
can be used as cout<<flush. For more information on buffer, read Section 3.4.
3.14 USER-DEFINED MANIPULATORS
The programmer can also define his or her own manipulator according to the requirement of the
program. The syntax for defining manipulator is as follows.
ostream & m_name ( ostream & o )
{
statement1;
statement2;
return o;
}
The m_name is the name of the manipulator.
3.46 Write a program to demonstrate ...