initializer element is not constant

来源:互联网 发布:闲鱼 淘宝二手 编辑:程序博客网 时间:2024/06/05 15:53

一般出现这种报错原因在于: 全局变量c的值不能在编译时确定,要在执行时确定

#include <stdio.h>int a = 1;int b = 1;int c = a+b;
问题出在int c=a+b;这是不可以的。


还有另一种情况报错,就是回调函数的使用,wakeup()是回调函数。

错误:registerEventCallback ( wakeup());

正确:registerEventCallback (& wakeup);

原创粉丝点击