C++ allows the programmer to use the same name in different contexts. This re-use of names is governed by a set of rules of visibility, a term that gives the rules a metaphorical nature.
There are four main kinds of scope: class scope, function scope, block scope, and file scope. A name has local scope if it declared between a pair of matched braces { }.
Copyright © 2003 Roger Hartley