今天运行的一段代码 总是出错 烦死了

来源:互联网 发布:腾讯云数据可视化 编辑:程序博客网 时间:2024/05/06 08:02

/*函数返回值中 指针型函数 完成strcat()功能*/
#include "string.h"
#include "stdio.h"
main()
{
 char *s,*s1,*s2;
 char *usercat(char *s1,char *s2);
 gets(s1);    /*gets()和scanf()的区别在于 gets()可以输入连续的字符串 包括空格 制表符*/
 gets(s2);
 s=usercat(s1,s2);
 printf("The new string is /n%s/n",s );     /*输出字符串%s*/
 getch();
}
 char *usercat(char *s1,char *s2)
{
 char *temp;
 temp=s1;
 while(*s1)
  s1++;
 while(*s2)
 {
  *s1=*s2;
  s1++;
  s2++;
 }
 *s1='/0';
 return temp;

 

总是显示

warning: Possible use of 's1' before definition in function main

原创粉丝点击