June 2014
Beginner
324 pages
6h 35m
English
Chapter 9
Controlling Data with Access Modifiers
C++ allows you to control how data in variables can be accessed by using different access modifiers. There are modifiers that tell the compiler that a variable should be shared among classes or that the program cannot change the value of the variable after it has been initialized. Unfortunately some of the keywords supplied by C++ are reused and mean different things in different circumstances. I’ll cover the use of the static, const, mutable, and friend keywords in C++, and their multiple uses in this chapter.
The static Keyword
The static keyword has four major uses in C++ programs:
Read now
Unlock full access