Controlling Data with Access Modifiers

  • Bruce Sutherland


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.


Constant Variable Access Modifier Static Void Global Scope Counter2 Object 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Bruce Sutherland 2014

Authors and Affiliations

  • Bruce Sutherland
    • 1
  1. 1.VICAustralia

Personalised recommendations