#include<stdio.h>
typedef enum gender{MALE,FEMALE}gender;
typedef struct person{
char name[20];
enum gender s;
int age;
double income;
}person;
int main()
{
person a;
person b={"name",MALE,80,8005};
printf("%s是%d%s,月薪%g\n",b.name,b.age,b.s==MALE?"男":"女",b.income);
person c={age:18,s:FEMALE,name:"jone",income:888.5};//这里的age报未定义的标识符问题
printf("%s是%d%s,月薪%g\n",c.name,c.age,c.s==MALE?"男":"女",c.income);
return 0;
}
typedef enum gender{MALE,FEMALE}gender;
typedef struct person{
char name[20];
enum gender s;
int age;
double income;
}person;
int main()
{
person a;
person b={"name",MALE,80,8005};
printf("%s是%d%s,月薪%g\n",b.name,b.age,b.s==MALE?"男":"女",b.income);
person c={age:18,s:FEMALE,name:"jone",income:888.5};//这里的age报未定义的标识符问题
printf("%s是%d%s,月薪%g\n",c.name,c.age,c.s==MALE?"男":"女",c.income);
return 0;
}