#ifndef student_h
#define student_h
const int len=20;
typedef struct student{
char name[len];
int gender;
int age;
} Stu;
#endif
variably modified at file scope
#ifndef student_h
#define student_h
const int len=20;
typedef struct student{
char name[len];
int gender;
int age;
} Stu;
#endif
variably modified at file scope
在C语言中,const不是一个真真正正的常量,其代表的含义仅仅是只读。使用const声明的对象是一个运行时对象,无法使用其作为某个量的初值、数组的长度、case的值或在类型的情形中使用,可以使用#define宏定义。