1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > “warning: the `gets' function is dangerous and should not be used.

“warning: the `gets' function is dangerous and should not be used.

时间:2023-04-22 12:41:15

相关推荐

“warning: the `gets' function is dangerous and should not be used.

在编译到时候碰到如下问题:

“warning: the `gets' function is dangerous and should not be used.

在另外一个环境下编译到时候是没有问题到,现在搬到另外一个环境下出该问题,可能是环境问题

在网上查了下,说是“ Linux 下gcc编译器不支持这个函数,解决办法是使用fgets

fgets()函数的基本用法为:fgets(char * s,int size,FILE * stream);

#include <stdio.h>int main() {char name[20];printf("\n 输入任意字符 : ");fgets(name, 20, stdin);//stdin 意思是键盘输入return 0;}

关键是,我用到是g++,也就是支持C++的编译器进行编译到,还是出现这样到错误,按说不应该吧??

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。