首先回忆一下C中的结构体的使用:
void test() {
//定义Date这种结构体类型
struct Date {
int year;
int month;
int day;
};
//定义结构体变量
struct Date d = {
2015,
6,
2};
d.day =
5;
}
void test2() {
//通过 typedf 来更加简便的定义结构体
typedef
struct Date {
int year;
int month;
int day;
} MyDate;
MyDate d = {
2015,
6,
2};
}
转载于:https://www.cnblogs.com/why-not/p/4716790.html
转载请注明原文地址: https://win8.8miu.com/read-1480657.html