我的编译器(GCC)向我发出警告:
警告:函数的隐式声明
请帮助我理解为什么会这样。
最佳答案
您正在使用编译器尚未看到声明(“原型”)的函数。
例如:
int main()
{
fun(2, "21"); /* The compiler has not seen the declaration. */
return 0;
}
int fun(int x, char *p)
{
/* ... */
}
您需要像下面这样直接在main或标头中声明函数:
int fun(int x, char *p);
关于c - 警告:函数的隐式声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27509736/