Summing Up

In this lesson, you have seen that classes are like structs with member functions. You have been introduced to the public and private visibility keywords and have learned that classes have special functions called constructors and destructors to allow for initialization and for freeing heap-allocated storage before destruction. You have seen that a class can have multiple constructors, including a copy constructor. Finally, you have seen how to declare types within a class declaration and use them outside the class.

Get SAMS Teach Yourself C++ in 10 Minutes SECOND 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.