August 2012
Intermediate to advanced
976 pages
30h 17m
English
At any particular point in a program, each name that is in use refers to a specific entity—a variable, function, type, and so on. However, a given name can be reused to refer to different entities at different points in the program.
A scope is a part of the program in which a name has a particular meaning. Most scopes in C++ are delimited by curly braces.
The same name can refer to different entities in different scopes. Names are visible from the point where they are declared until the end of the scope in which the declaration appears.
As an example, consider the program from § 1.4.2 (p. 13):
#include <iostream>int main() ...
Read now
Unlock full access