The obvious answer is to learn from what the compiler is trying to tell you - you should never, ever, use gets(), as it is totally unsafe. Use fgets() instead, which allows you to prevent possible buffer overruns.#define BUFFER_SIZE 100char buff[BUFFER_SIZE];gets( buff); // unsafe!fgets( buff, sizeof(buff), stdin ); // safe 这篇关于禁用警告:通过头文件,“获取"功能在GCC中是危险的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-18 17:13