- #include<stdio.h>
- int main(){
- struct son{
- char *name;
- char *gender;
- int *age;
- };
-
- struct wife{
- char *name;
- int age;
- struct son son;
- };
-
- struct wife wife1={"heimaketang",20,{"shuangyuanban","male",2}};
-
- printf("妻子的名字是%s,年龄是%d,她的孩子是%s,性别是%s,年龄是%d\n",wife1.name,wife1.age,wife1.son.name,wife1.son.gender,wife1.son.age);
-
- return 0;
-
- }
复制代码 |
|