不知道Xcode用gets為何會提示
warning: this program uses gets(), which is unsafe.
不知道Xcode用gets為何會提示
warning: this program uses gets(), which is unsafe.
因為gets()無法限制字串長度,可能會造成overflow,scanf("%s", s)也是一樣,所以有人建議用fgets()。
可參考https://stackoverflow.com/questions/1694036/why-is-the-gets-function-so-dangerous-that-it-should-not-be-used