This documentation is archived and is not being maintained.

Hiding Names

You can hide a name by declaring it in an enclosed block. In the following figure, i is redeclared within the inner block, thereby hiding the variable associated with i in the outer block scope.

Block Scope and Name Hiding


Block Scope Name Hiding

The output from the program shown in the figure is:

i = 0
i = 7
j = 9
i = 0
NoteNote

The argument szWhat is considered to be in the scope of the function. Therefore, it is treated as if it had been declared in the outermost block of the function.

Reference

Scope

Show: