manipulatorsthere are several classes in the


Manipulators

There are several classes in the iostream.h header file. One of them is ios class. This class stores the format state. For example, some bits explain the base in which the numbers will be printed, some bits explain the field width. This header file has functions called manipulators, using which the output format can be controlled. There are 3 manipulators dec(), oct(), hex() to set the base in which a given number will be printed. These manipulators are called in two ways :

                hex(cout);                                           // Pass the object name

                cout<< hex;                        // use the insertion operator .

 

But since these manipulators are not member functions of the class , it cannot be used as follows :

                cout.hex();                         // Not allowed.

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: manipulatorsthere are several classes in the
Reference No:- TGS0309494

Expected delivery within 24 Hours