Reliable Software Logo
 Home  >  C++ Resources  > C++ In Action Book > Language: Objects and Scopes

C++ In Action: Language

Objects and Scopes

What's the most important thing in the Universe? Is it matter? It seems like everything is built from matter-galaxies, stars, planets, houses, cars and even us, programmers. But what's matter without energy? The Universe would be dead without it. Energy is the source of change, movement, life. But what is matter and energy without space and time? We need space into which to put matter, and we need time to see matter change.

Programming is like creating universes. We need matter: data structures, objects, variables. We need energy--the executable code--the life force of the program. Objects would be dead without code that operates on them. Objects need space to be put into and to relate to each other. Lines of code need time to be executed. The space-time of the program is described by scopes. An object lives and dies by its scope. Lines of executable code operate within scopes. Scopes provide the structure to program's space and time. And ultimately programming is about structure.



  1. Global Scope
  2. Local Scope
  3. Embedded Objects
  4. Inheritance
  5. Member Functions and Interfaces
  6. Member Function Scope
  7. Types
  8. Summary
  9. Word of Caution
  10. Exercises
  11. Abstract Data Types
  12. Exercises