#include <stdio.h>
int main(){
struct Person{
char *name;
int age;
char *sex;
};
struct Person per1={"xiaoming",22,"boy"};
struct Person per2={"xiaohua",20,"girl"};
struct Person person[]={per1,per2};
for(int i=0;i<2;i++){
printf("%s---%d---%s\n",person[i].name,person[i].age,person[i].sex);
}
return 0;
} |
|