本博客已迁往http://coredumper.cn
不使用typedef的情况:
有如下两种定义结构变量x的方式:
struct str{
int a;
double b;
};
struct str x;
struct str{
int a;
double b;
}x;
使用typedef的情况:
有如下三种定义结构变量x的方式:
typedef struct str{
int a;
double b;
}STR;
STR x;
typedef struct{
int a;
double b;
}STR;
STR x;
struct str{
int a;
double b;
};
typedef struct str STR;
STR x;