Answers to Self-Review Exercises
-
dot (
.
), arrow (->
).private
.public
.Default memberwise assignment (performed by the assignment operator).
friend
.initialized.
static
.this
.const
.default constructor.
non-
static
.before.
::
scope resolution operator.
-
Error: Destructors are not allowed to return values (or even specify a return type) or take arguments.
Correction: Remove the return type
void
and the parameterint
from the declaration.Error: Constructors are not allowed to return values.
Correction: Remove the return type
int
from the declaration.Error: The class definition for
Example
has two errors. The first occurs in functiongetIncrementedData
. The function is declaredconst
, but it modifies the object.Correction: To correct ...
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.