Manipulator types - C++ basic concepts

Q.  Which of the followings is/are not a manipulator/s ?

1. flush
2. base
3. ends
4. oct
5. bin
6. skipws

- Published on 17 Jul 15

a. Only 1, 6
b. Only 1,4,6
c. Only 1,3,6
d. Only 2,5

ANSWER: Only 2,5


  • Brijesh   -Posted on 12 Oct 15
    Manipulator are special functions that are used to change certain characteristics of the input and output. They change the format flags and values for a stream.
    Following are the standard manipulators:
    hex, dec, oct
    you can also create your own manipulators. The syntax for creating user defined manipulators is defined as follows:
    ostream & manipulator_name(ostream & ostrObj)
    set of statements;
    return ostrObj;

    In the above question base and bin are not the manipulators.

Post your comment / Share knowledge

Enter the code shown above:
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)