[C]struct初识
#include <stdio.h> #include <string.h> struct date { int day; //int month; char month[10]; int year; }; //别丢掉这里的逗号 int main() { struct date today; today.day = 4; //today.month = 6; strcpy(today.month, "May"); today.year = 2020; printf("Today is %s-%d-%d\n", today.month, today.day, today.year); return 0; }