1.

Differentiate Between The Manipulator And Setf( ) Function?

Answer»

The DIFFERENCE between the manipulator and setf( ) function are as follows:

The setf( ) function is used to set the FLAGS of the ios but manipulators DIRECTLY insert the formatting instructions into the stream. We can create user-defined manipulators but setf( ) function uses data MEMBERS of ios class only. The flags PUT on through the setf( ) function can be put off through unsetf( ) function. Such flexibility is not available with manipulators.

The difference between the manipulator and setf( ) function are as follows:

The setf( ) function is used to set the flags of the ios but manipulators directly insert the formatting instructions into the stream. We can create user-defined manipulators but setf( ) function uses data members of ios class only. The flags put on through the setf( ) function can be put off through unsetf( ) function. Such flexibility is not available with manipulators.



Discussion

No Comment Found