- C语言编译时头文件报错,提示error:excess elements in char array initializer。
这一般是由于#define以换行结束。即#define后的内容未完进行了换行,导致编译器认为该语句已经结束。
将空行删掉或者加一个\
进行拼接就行 - C语言编译时报错,提示:error: too few arguments to function ‘xxxxxxx’
这是由于函数的调用时传入的参数和函数声明时定义的参数数量对不上
比如:函数的声明为bool print_data(const char *tableName);
,但是调用时却是print_data();
。就会导致以上报错。 - C语言编译时报错,提示:
error: static declaration of 'print_data' follows non-static declaration
这是由于函数声明不匹配,可能是函数声明时带了static
关键字:static void print_id(char *id);
,但是在函数实现时却没有static
关键字:void print_id(char *id){}
C语言编译出现错误
于 2023-11-01 17:02:57 首次发布