Coupon Accepted Successfully!


Manipulator With One Parameter

The prototype declared in the iomanip.h as described earlier allows us to define individual set of macros. The manipulator can be created without the use of int or long argument.

Explanation: In the above program, middle is a user-defined parameterized manipulator. It receives a value strlen (m), that is, string length. The header file IOMANIO.H defines a macro, OMANIO (int). It is expanded to class_OMANIP_int. Due to this, the definition consists of a constructor and an overloaded ostream insertion operator. When middle() function is added into the stream, it invokes the constructor which generates and returns an OMANIP_int object. The fc() function is called by the object constructor.

Test Your Skills Now!
Take a Quiz now
Reviewer Name