结构体变量

在定义结构体变量之前,需要先申明该结构体类型。
错误样例:

点击查看代码
stu st1;

struct stu
{
  int age;
  char name[20];
};//error

正确样例:

点击查看代码
struct stu
{
  int age;
  char name[20];
};

stu st1;//true
posted @ 2021-10-15 18:57  banyanrong  阅读(161)  评论(0)    收藏  举报