探讨结构体的作用
#include <stdio.h>struct date//date是结构体名
{
int day;
int month;
int year;
};
int main(void)
{
struct date day1;//定义了一个结构体变量day1
day1.day = 8;
day1.month = 11;
day1.year = 2019;
printf("Today is :%d-%d-%d\n",day1.year,day1.month,day1.day);
return 0;
}
页:
[1]