Static Class Members
In this section, I will generalize the notion of a class data member. Conceptually, a class is a blueprint for objects. The class specification describes what each object of that class has: data and functions.
This is why when you create an instance of a class object, a separate set of data members is created for that object. This happens no matter how you create the object, either through a definition of an object as a local or a global named variable, with the new operator as an unnamed dynamic variable, passing an object by value as a function parameter, or returning an object from a function by value. Each object instance has its own set of data member values: private, public, or protected.
There is no need to create ...
Get Core C++ A Software Engineering Approach 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.