warning: the `gets' function is dangerous and should not be used.
来源:互联网 发布:创业软件办公平台 编辑:程序博客网 时间:2024/06/05 00:11
问题出在程序中使用了 gets Linux 下gcc编译器不支持这个函数,解决办法是使用 fgets
/* 代码实现 */
#include <stdio.h>
int main ( ) {
char name[20];
printf("\n 输入任意字符 : ");
fgets(name, 20, stdin);//stdin 意思是键盘输入
fputs(name, stdout); //stdout 输出
return 0;
}
fgets()函数的基本用法为:fgets(char * s,int size,FILE * stream);
/* 代码实现 */
#include <stdio.h>
int main ( ) {
char name[20];
printf("\n 输入任意字符 : ");
fgets(name, 20, stdin);//stdin 意思是键盘输入
fputs(name, stdout); //stdout 输出
return 0;
}
- the `gets' function is dangerous and should not be used.
- warning: the `gets' function is dangerous and should not be used.
- warning: the `gets' function is dangerous and should not be used.
- “warning: the `gets' function is dangerous and should not be used.
- warning: the 'gets' function is dangerous and should not be used.的解决办法
- warning: the 'gets' function is dangerous and should not be used.的解决办法
- Linux下开发warning:"the `gets' function is dangerous and should not be used"
- warning: the 'gets' function is dangerous and should not be used.的解决办法
- warning: the `gets' function is dangerous and should not be used.
- warning: the `gets' function is dangerous and should not be used.
- warning: the `gets' function is dangerous and should not be used.
- warning: the ‘gets' function is dangerous and should not be used
- warning: the gets function is dangerous and should not be used.
- the update-modules command is deprecated and should not be used
- Why the "volatile" type class should not be used
- The function default must be used with a prefix when a default namespace is not specified
- The function getXX must be used with a prefix when a default namespace is not specified
- The function size must be used with a prefix when a default namespace is not specified
- 从零开始
- 20. A friend in need is a friend indeed. 患难见真情
- 基数排序
- 最老程序员创业札记:全文检索、数据挖掘、推荐引擎应用4
- 懂了生死,才有了伤悲——读《巨流河》有感
- warning: the `gets' function is dangerous and should not be used.
- 1731 圣诞节礼物
- ext开发环境总结
- python 写的两种打印全排列的方法速度对比
- 用匈牙利算法求二分图的最大匹配
- 1732 隐藏的BUAA
- 1733 盒子工厂
- HDOJ 1150 Machine Schedule解题报告
- C [ OPENMP ]