Answers to Self-Review Exercises

  1. 13.1

    1. streams.

    2. left, right and internal.

    3. flags.

    4. <iostream>.

    5. <iomanip>.

    6. showpos.

    7. write.

    8. istream.

    9. cerr or clog.

    10. ostream.

    11. <<.

    12. cin, cout, cerr and clog.

    13. >>.

    14. oct, hex and dec.

  2. 13.2

    1. False. The stream member function flags with a fmtflags argument sets the flags state variable to its argument and returns the prior state settings.

    2. False. The stream insertion and stream extraction operators are not overloaded for all user-defined types. You must specifically provide the overloaded operator functions to overload the stream operators for use with each user-defined type you create.

    3. False. The stream member function flags with no arguments returns the current format settings as a fmtflags data type, which represents the ...

Get C++ How to Program, 10/e now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.