Day 15. Special Classes and Functions

C++ offers several ways to limit the scope and impact of variables and pointers. So far, you’ve seen how to create global variables, local function variables, pointers to variables, and class member variables.

Today, you will learn

• How to share information across objects of the same type

• What static member variables and static member functions are

• How to use static member variables and static member functions

• How to create and manipulate pointers to functions and pointers to member functions

• How to work with arrays of pointers to functions

Sharing Data Among Objects of the Same Type: Static Member Data

Until now, you have probably thought of the data in each object as unique to that object and ...

Get Sams Teach Yourself C++ in 21 Days , 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.