Self-Review Exercises
-
21.1 Fill in the blanks in each of the following:
Header must be included for class
string
.Class
string
belongs to thenamespace
.Function deletes characters from a
string
.Function finds the first occurrence of one of several characters from a
string
.
-
21.2 State which of the following statements are true and which are false. If a statement is false, explain why.
Concatenation of
string
objects can be performed with the addition assignment operator,+=
.Characters within a
string
begin at index0
.The assignment operator,
=
, copies astring
.A pointer-based string is a
string
object.
-
21.3 Find the error(s) in each of the following, and explain how to correct it (them):
string string1{ ...
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.