Class Scope and the Overriding of Names in Nested Scopes

The actual times of constructor/destructor invocations depend on the scope and storage class of the object instances.

Scope defines the accessibility of variables and objects for different parts of the program code. Storage class defines the lifetime of variables and objects from their creation to their destruction. This section extends the discussion of scope and storage class from Chapter 6. If you feel that it is too complex, you can skip it during the first reading. (I hope there will be a second reading.) This material is important, but it can wait until you accumulate more experience with writing and reading C++ code.

Since a global variable can be defined anywhere in the file, even ...

Get Core C++ A Software Engineering Approach 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.