原文: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