【发布时间】:2011-07-20 03:18:16
【问题描述】:
可能重复:
Why is the `gets' function is dangerous? Why should not be used?
刚开始学习套接字编程。但是在用 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);
【问题讨论】:
标签: c