typedef01.c
来自「this is a gcc file, you can download it 」· C语言 代码 · 共 47 行
C
47 行
// Build don't link://980205 bkoz//7.1.3 the typedef specifier//p1typedef int MILES, *KLICKSP;MILES distance;extern KLICKSP metricp;//p2--can redefine to same typetypedef struct s { /* ... */ } s;typedef int I;typedef int I;typedef I I;//p3--cannot redefine to a different type in a given scopeclass complex2 { /* ... */ };// ERROR - .*typedef int complex2;// ERROR - .*typedef int complex3;// ERROR - .*class complex3 { /* ... */ };// ERROR - .*//p4/*4 A typedef-name that names a class is a class-name (_class.name_). If a typedef-name is used 1) following the class-key in an elaborated-type-specifier 2) or in the class-head of a class declaration 3) or is used as the identifier in the declarator for a constructor or destructor declaration the program is ill-formed. [Example:*/struct S { S(); ~S();};typedef struct S T;S a = T(); // OK struct T * p; // ERROR - using typedef after struct//case01typedef bool short;// ERROR - .*
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?