摘要: 学过C的都知道gets()函数是用来接收字符串的一个函数,以前用的时候感觉挺好使的,但是今天碰到了一个问题。 本人写的程序如下:1 #include <stdio.h>2 int main(void)3 {4 char name[10];5 gets(name);6 puts(name);7 } 这个程序最简单不过了,就是一个字符串输出输入的问题,但是使用linux下的gcc编译老是不能通过,提示的问题是: “the 'gets' function is dangerous and shout not be used.” 让我很纠结,为什么这个函数不让使用,... 阅读全文
posted @ 2012-11-26 17:25 net小伙 阅读(34164) 评论(12) 推荐(2) 编辑