#include<stdio.h>
#include<string.h>
main()
{
char st1[30]="My name is:";
int st2[10];
printf("please insert your name\n");
gets(st2);
strcat(st1,st2);
puts(st1);
}
gcc -o 之后
7.14.c: 在函数 ‘main’ 中:
7.14.c:8: 警告:传递参数 1 (属于 ‘gets’)时在不兼容的指针类型间转换
7.14.c:9: 警告:传递参数 2 (属于 ‘strcat’)时在不兼容的指针类型间转换
/tmp/cc96MPyp.o: In function `main':
7.14.c.text+0x24): warning: the `gets' function is dangerous and should not be used.