原文:linux系统下,警告:warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] 和 warning: the `gets' function is dangerous and should not be used. 的由来和解决方法。

字符数组 的英文名字是 char gets 函数的基本用法为:char gets char s 该函数的参数是一个字符数组,该函数的返回值也是一个字符数组。 linux下的代码如下: include lt stdio.h gt int main char a gets a printf s n , a return 编译时会出现一个warning,建议我们不要使用gets函数了。我们暂时不管他,先 ...

2017-12-30 18:56 0 7495 推荐指数:

查看详情

implicit declaration of function 警告解决方法

这个问题其实是很低级的问题,但是经常还是容易发生,翻译就是函数的隐式说明 原因: 是因为函数没有在头文件(.h)定义,这就导致编译的时候没法正确生成.o文件 ...

Tue Mar 30 00:47:00 CST 2021 0 576
【转】implicit declaration of function 这种警告问题的原因及解决方法

在改掉所有的warning时老报一个implicit declaration of function警告错误,上网查了原因,原来有两种情况会产生这种情况 1 没有把函数所在的c文件生成.o目标文件2 在函数所在的c文件中定义了,但是没有在与之相关联的.h文件中声明 转:http ...

Sun May 10 07:01:00 CST 2020 0 1522
【转】implicit declaration of function 这种警告问题的原因及解决方法

在改掉所有的warning时老报一个implicit declaration of function警告错误,上网查了原因,原来有两种情况会产生这种情况 1 没有把函数所在的c文件生成.o目标文件2 在函数所在的c文件中定义了,但是没有在与之相关联的.h文件中声明 http ...

Mon Sep 26 22:06:00 CST 2016 1 73881
【转】implicit declaration of function 这种警告问题的原因及解决方法

在改掉所有的warning时老报一个implicit declaration of function警告错误,上网查了原因,原来有两种情况会产生这种情况 1 没有把函数所在的c文件生成.o目标文件。2 在函数所在的c文件中定义了,但是没有在与之相关联的.h文件中声明。 3 其头文件 ...

Thu Jun 13 22:38:00 CST 2019 0 26790
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM