这里的结构体中的年月日如何传递进来?
/*分配一段区域,存放一个学生信息。*/#include <stdio.h>
main()
{
struct data
{
int month;
int day;
int year;
};
struct stu{
char *name;
char *sex;
struct data *birthday;
float score;
} *ps;
ps = (struct stu*)malloc(sizeof(struct stu));
ps->name = "MrDong";
ps->sex = "MEN";
ps->birthday = 06,11,1995;
ps->score = 100;
printf("name = %s\nsex = %s\n",ps->name,ps->sex);
printf("birthday = %d\nscore = %f\n",ps->birthday,ps->score);
system("pause");
}
/* 输出结果为:
name = MrDong
sex = MEN
birthday = 6
score = 100.000000
请按任意键继续. . .
*/