|
不使用typedef的情况:
有如下两种定义结构变量x的方式:
[cpp]
struct str{
int a;
double b;
};
struct str x;
[cpp]
struct str{
int a;
double b;
}x;
使用typedef的情况:
有如下两种定义结构变量x的方式:
[cpp]
typedef struct str{
int a;
double b;
}STR;
STR x;
[cpp]
typedef struct{
int a;
double b;
}STR;
STR x;
|