typedef语句的功能
将数据类型重命名
typedef语句的使用格式
typedef 已有的数据类型 新名称
使用举例
利用typedef语句定义一个名为type1的结构类型
法一:
typedef struct {
int x;
int y;
}type1;
法二:
struct type1 {
int x;
int y;
};
typedef struct type1 type1;
将数据类型重命名
typedef 已有的数据类型 新名称
利用typedef语句定义一个名为type1的结构类型
法一:
typedef struct {
int x;
int y;
}type1;
法二:
struct type1 {
int x;
int y;
};
typedef struct type1 type1;