大神们帮我看看下面那个被注释的地方错在哪了?谢谢
#include <stdio.h>
int main(){
struct parents{
char *name;
int age;
};
struct family{
char *name;
int age;
char *statue;
struct parents grendfather;
};
struct family father={"夏父亲",30,"爸爸",{"夏爷爷",50}};
//father.grendfather={"夏爷爷",50};
struct family mother={"夏母亲",26,"妈妈"};
struct family son={"夏儿子",1,"宝宝"};
struct family *p=&father;
struct family *p1=&mother;
struct family *p2=&son;
struct family *p3=&father;
printf("姓名=%s\t年龄=%d\t身份=%s\n",(*p).name,(*p).age,(*p).statue);
printf("姓名=%s\t年龄=%d\t身份=%s\n",(*p1).name,(*p1).age,(*p1).statue);
printf("姓名=%s\t年龄=%d\t身份=%s\n",(*p2).name,(*p2).age,(*p2).statue);
printf("姓名=%s\t年龄=%d\t\n",(*p3).grendfather.name,(*p3).grendfather.age);
}
|
|