可能重複:
Why is the `gets' function is dangerous? Why should not be used?爲什麼fgets()在gcc(linux)中考慮以及使用它的替代方法是什麼?
我propting用戶輸入使用與fgets(),這將使用scanf()的區分整數來分析一個字符串,花車和chars.I希望一個可靠的程序,但我收到以下警告使用gcc:
在函數main': : warning: the
得到'功能是危險的,不應該使用。
有人可以告訴我爲什麼它是危險的,它有什麼安全的選擇? 如果有人能告訴我fgets()的致命的嚴重性,那將是非常有用的。
你可能意思是爲什麼'gets()'被認爲是危險的 - 而'fgets()'是另一種選擇:[爲什麼'gets'函數是危險的?爲什麼不應該使用?](http://stackoverflow.com/questions/1694036/why-is-the-gets-function-is-dangerous-why-should-not-be-used) – birryree
好吧夥計,我的錯誤,對不起,我用我的程序gets()並寫了一個關於fgets()的問題 –