union的变量共用内存.
#include <stdio.h>
typedef struct Leix{
char profession;//职业
int height;
union{
int score ;
char* course;};
}Leix;
int main(){
/*初始化student*/
Leix student={'t',171,90};
/*初始化teacher*/
Leix teacher;
teacher.profession='t';
teacher.course="Chinese";
teacher.score=91;
printf("teacher profession:%c,course=%s,score=%d",teacher.profession,teacher.course,teacher.score);
return 0;
}