**今天用VC6.0这款老古董写项目的时候,写了这样的代码:
(全局变量) Node * head=(Node )malloc(len);
编译器直接报错,error:initializer element is not constant
后来才知道,C99规定全局变量或者是static变量必须用常量表达式初始化;
所以把语句拆开写。
(全局变量) Node * head=NULL;
(函数中) head=(Node )malloc(len);
C99的特性:error:initializer element is not constant
最新推荐文章于 2023-01-17 15:24:32 发布