Exercises

  1. 21.4 (Fill in the Blanks) Fill in the blanks in each of the following:

    1. Class string member function       converts a string to a pointer-based string.

    2. Class string member function       is used for assignment.

    3.       is the return type of function rbegin.

    4. Class string member function       is used to retrieve a substring.

  2. 21.5 (True or False) State which of the following statements are true and which are false. If a statement is false, explain why.

    1. strings are always null terminated.

    2. Class string member function max_size returns the maximum size for a string.

    3. Class string member function at can throw an out_of_range exception.

    4. Class string member function begin returns an iterator.

  3. 21.6 (Find Code Errors) Find any errors ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.