Quantcast
Channel: Comments on: 11.4 — Constructors and initialization of derived classes
Viewing all articles
Browse latest Browse all 159

By: Moj

$
0
0

Alex for the quiz problem I neglected to write the "const" in these lines:

and compiler refused to compile my program. I think this is because we wrote for example

in the header of our operator<<-overloading-functions and thus when we used a.getName() compiler could not guarantee that the object will survive unchanged in getName() function so did not do the job… . Am I right? (Sorry for poor English)


Viewing all articles
Browse latest Browse all 159

Trending Articles