/*C語言 巢狀結構*/
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
struct date
{
char month[10];
int day;
};
struct data
{
char name[10];
int score;
struct date i;
}student = { "Jackson", 81, {"July", 7} };
printf("student姓名:%s\n", student.name);
printf("student分數:%d\n", student.score);
printf("student日期:%s %d\n",
student.i.month, student.i.day);
system("pause");
return 0;
}
結果為:
文章標籤
全站熱搜
留言列表