O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Class as a Mini-Program

In previous lessons, you have seen almost everything you need for an easy understanding of class types. You have learned to define and use functions for processing and to define and use structs to contain data. Now you will learn about classes, which are structs with member functions as well as member variables, and which can both contain and process data.

A variable of a class type is usually referred to as an object.

Just as a program's or function's internal state is based on the content of its variables, an object's internal state is based on the content of its member variables. The content of member variables can change as control flows through the member functions of an object, and the object will retain those ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required