#include <stdio.h> int main()
{
/***************************************************
*结构体嵌套:结构体里面包含结构体
*
*注意:被包含的结构体要先定义,结构体不能包含自己
****************************************************/
struct Date
{
int year;
int month;
int day;
};
struct Student
{
int no;
struct Date birthday;
};
struct Student student =
{
,
{, , }
};
printf("no = %d, birthday = %d年%d月%d日 \n", student.no,
student.birthday.year, student.birthday.month, student.birthday.day);
return ;
}
no = , birthday = 1989年2月4日