1 #include <stdio.h> 2 3 int main() 4 { 5 struct Date 6 { 7 int year; 8 int month; 9 int day;10 };11 12 13 // 類(lèi)型14 struct Student15 {16 int no; // 學(xué)號(hào)17 18 struct Date birthday; // 生日19 20 struct Date ruxueDate; // 入學(xué)日期21 22 // 這種寫(xiě)法是錯(cuò)誤的23 //struct Student stu;24 };25 26 27 struct Student stu = {1, {2000, 9, 10}, {2012, 9, 10}};28 29 PRintf("year=%d,month=%d,day=%d/n", stu.birthday.year, stu.birthday.month, stu.birthday.day);30 31 32 33 34 35 return 0;36 }
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注