可能重复:
Why is the `gets' function is dangerous? Why should not be used?错误使用获取,因为它是危险的?
刚刚开始socket编程教程。但是在使用gcc编译后出现这个错误。如何克服这个危险?
In function `main':
tcpserver.c:(.text+0x1f3): warning: the `gets' function is dangerous and should not be used.
这行代码是从网上(http://www.prasannatech.net/2008/07/socket-programming-tutorial.html)获得:
printf("\n Your message (hit q or Q to quit): ");
gets(send_data);
请参阅[为什么'gets'函数是危险的?为什么不应该使用?](http://stackoverflow.com/questions/1694036/why-is-the-gets-function-is-dangerous-why-should-not-be-used) – 2011-03-22 01:38:28
参见http:/ /stackoverflow.com/questions/4023895/how-to-read-string-entered-by-user-in-c/4023921#4023921 – paxdiablo 2011-03-22 01:58:58