写了一段代码,然后报错了:
#include <stdio.h>
#include <stdlib.h>
typedef struct ListNode {
int val;
struct ListNode* next;
}node, *linkList;
linkList l = (linkList)malloc(sizeof(node));
int main() {
return 0;
}
[错误] initializer element is not constant
原因: 全局变量c的值不能在编译时确定,要在执行是确定(编译原理。。)
引用文献
为什么出现“initializer element is not constant”错误_d4shman的博客-CSDN博客