c/language/name space

When an is encountered in a C program, a lookup is performed to locate the  that introduced that identifier and that is currently. C allows more than one declaration for the same identifier to be in scope simultaneously if these identifiers belong to different categories, called name spaces: @1@ Label name space: all identifiers declared as. @2@ Tag names: all identifiers declared as names of s, s and. Note that all three kinds of tags share one name space. @3@ Member names: all identifiers declared as members of any one or. Every struct and union introduces its own name space of this kind.

@6@ All other identifiers, called ordinary identifiers to distinguish from (function names, object names, typedef names, enumeration constants).

At the point of lookup, the name space of an identifier is determined by the manner in which it is used: @1@ identifier appearing as the operand of a is looked up in the label name space. @2@ identifier that follows the keyword, , or is looked up in the tag name space. @3@ identifier that follows the or member access through pointer operator is looked up in the name space of members of the type determined by the left-hand operand of the member access operator.

@6@ all other identifiers are looked up in the name space of ordinary identifiers.