#include <stdio.h>
int main(){
struct Family{
char *name;int age;char *idCard;
};
struct Family per={"撑起整个家",41,"爸爸"};
struct Family per1={"打理整个家",39,"妈妈"};
struct Family per2={"家里的宝",20,"儿子"};
struct Family arr[3]={per,per1,per2};
for(int i=0;i<3;i++){
printf("%s,%d,%s\n",arr[i].name,arr[i].age,arr[i].name);
}
return 0;
} |
|