gcc不支持标准c的gets与puts函数
来源:互联网 发布:java中的cgi 编辑:程序博客网 时间:2024/05/29 17:42
一段c源程序代码如下:#include"stdio.h"
main(){char st[15];printf("input string:\n");gets(st);puts(st);}
编译执行报如下错误,
(.text+0x24): warning: the `gets' function is dangerous and should not be used.
该提示说明linux下gcc不支标准c的gets,puts函数,可以用gcc fgets,fputs分别代替gets,puts,其格式及
(.text+0x24): warning: the `gets' function is dangerous and should not be used.
该提示说明linux下gcc不支标准c的gets,puts函数,可以用gcc fgets,fputs分别代替gets,puts,其格式及
更改如下:
#include "stdio.h"main(){char st[15];printf("input string:\n");fgets(st,15,stdin); /*stdin 键盘输入*/fputs(st,stdout); /*stdout 标准输出*/}
这样就不会报错了。
0 0
- gcc不支持标准c的gets与puts函数
- gcc不支持标准c的gets puts函数
- gcc 里不能使用gets() 和 puts() 函数的解决办法
- gets()函数与puts()函数
- C语言 gets(),puts()函数
- C语言puts与gets问题
- gets()函数puts()函数
- gets()gets_s()puts()函数的使用
- gets和puts函数
- C/C++中输入输出函数gets(),puts(),getchar(),putchar()等的解析
- DSP 调用 C 输入输出函数 scanf() printf() gets() puts()
- C语言基础—字符串输入输出函数puts和gets
- 字符与字符串处理之getchar,gets,putchar,puts函数
- gets()函数和puts()函数的渊源关系
- c语言中的 puts gets
- fgets、gets与fputs、puts
- gets()与puts()和cin>>与cout<<的比较
- 字符串函数的使用...strcat...puts...gets...strlen...strcmp...strcpy
- C语言 之建立动态链接库
- 在Fragment嵌套Fragment使用中,出现第二次使用空白
- 【数据库概览】关系型到非关系型
- Mockito的使用 二
- 图片旋转纠正
- gcc不支持标准c的gets与puts函数
- 基于Centos7的pip安装tensorflow
- PHP array_multisort—对多个数组或多维数组进行排序
- 学习转载系列-《安卓自定义View教程目录》
- 安卓使用”百度地图SDK“的技术总结以及“常见错误处理”
- python3入门学习
- Scala学习第十七弹 类
- BZOJ2795 [Poi2012]A Horrible Poem
- iptables的使用方法(带常用实例)