Classes with Object Members
Let's begin with classes that include class objects as members. Some classes, such as the String class of Chapter 11 or the standard C++ classes and templates of Chapter 15, offer convenient ways of representing components of a more extensive class. We'll look at a particular example now.
What is a student? Someone enrolled in a school? Someone engaged in thoughtful investigation? A refugee from the harsh exigencies of the real world? Someone with an identifying name and a set of quiz scores? Clearly, the last definition is a totally inadequate characterization of a person, but it is well-suited for a simple computer representation. So let's develop a Student class based on that definition.
Simplifying a student to ...
Get The Waite Group's C++ Primer Plus, Third Edition 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.