在C中键入命名空间

Cly*_*men 4 c struct typedef unions

我已经在SO中读到了C中定义类型的不同命名空间,例如,Structs和Unions有一个命名空间,typedef有一个命名空间.

命名空间是这个的确切名称吗?C中存在多少个命名空间?

Jee*_*tel 5

见6.2.3

来自http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

6.2.3标识符的名称空间

If more than one declaration of a particular identifier is visible at
any point in a translation unit, the syntactic context disambiguates uses
that refer   to different entities.

 Thus, there are separate name spaces for various categories of identifiers,
as follows:
— label names (disambiguated by the syntax of the label declaration and use);

— the tags of structures, unions, and enumerations (disambiguated by 
 following any32) of the keywords struct, union, or enum);

— the members of structures or unions; each structure or union has a 
separate name space for its members (disambiguated by the type of the 
expression used to access themember via the . or -> operator);

— all other identifiers, called ordinary identifiers (declared in ordinary 
  declarators or as enumeration constants).
Run Code Online (Sandbox Code Playgroud)