结构体类型变量定义
使用struct
关键字同时定义结构体类型和变量,例如:
struct student {
int num;
char name[20];
char sex;
int age;
float score;
char addr[30];
};
struct student s1, s2;
此代码定义了一个名为student
的结构体类型,并定义了两个该类型的变量s1
和s2
。
2.2MB
文件大小:
评论区