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,其格式及
main()
{
char st[15];
printf("input string:\n");
fgets(st,15,stdin); /*stdin 意思是键盘输入*/
fputs(st,stdout); /*stdout标准输出*/
}
这样就不会报错了。