Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Class opening and closing braces (and the closing semicolon) form the class scope pretty much in the same way as an ordinary structure forms a separate scope for its fields. This class scope, which is nested within the file scope, is similar to the scope of an ordinary structure. The difference is that the class scope can nest function scopes.
Nonmember functions (e.g., access functions in Listing 9.1) are global functions, and their names must be unique in the program (unless they are made static in the file scope, but only a small minority of functions can be made static in the file scope; more on static functions can be found in Chapter 6, "Memory Management. The Stack and The Heap," and later in this chapter). Normally, only those team members that use class Cylinder should learn about these function names because they are going to call this functions. In practice, every team member should learn about these names to avoid accidental name conflicts. This information obstructs the channels of communication among programmers.