More About Member Functions

Member functions and constructors are even more fun than what you’ve learned so far. This Exploration continues to uncover their mysteries.

Revisiting Project 1

What did you find most frustrating about Project 1 (Exploration 28)? If you are anything like me (although I hope you’re not, for your own sake), you may have been disappointed that you had to define several separate vectors to store one set of records. However, without knowing about classes, that was the only feasible approach. Now that you’ve been introduced to classes, you can fix the program. Write a class definition to store one record. ...

Get Exploring C++ 11, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.