[我一直在研究其他问题,但没有一个解决方案有效,所以我会问我自己的问题。
我正在Ubuntu Kylin16.04(中国版)上工作,编译我的代码时遇到问题,这是我的gets函数,编译器收到的错误] 1
最佳答案
函数的隐式声明意味着您通常在头文件中没有函数引用。
或者也许你有它,但是调用你的函数的文件看不到它。
//Declaration, must always be before first function call
void myfunc(void);
//Function usage somewhere in the code
int main(void) {
//Call it here, compiler see the reference and knows what type
//of func it is and what parameters should be used to func
myfunc();
}
//Definition, write function content here
//This part will be compiled in separate way, linked will put everything together
void myfunc(void) {
//Write function content here
}
关于c - 函数的隐式声明 ‘mygets’ [-Wimplicit-function-declaration] mygets(str1);,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42954363/