Hour 20. Using Special Classes, Functions, and Pointers
Static Member Data
Until now, you have probably thought of the data in each object as unique to that object and not shared among objects in a class. For example, if you have five Cat
objects, each has its own age, weight, and other data. The age of one does not affect the age of another.
Sometimes, however, you’ll want to keep track of information shared among the many objects of a class. ...
Get Sams Teach Yourself C++ in 24 Hours, fifth 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.