C++改错:连接字符串

又是一道改错题....
#include <stdio.h>
void strc (char *s,char *t);
int main (void)
{
char s[80],t[80];

gets (s);
gets (t);
strc (s,t);
puts (t);

return 0;
}
void strc (char *s,char *t)
{
while (*t!='\0')
t++;
while (*t=*s)
;
}
不能改变题目本身原有的思路
错题汇总:
错误行号: 正确语句:
错误行号: 正确语句:
错误行号: 正确语句:
也有可能是题目有哪儿错了哦,欢迎指出^_^

两个地方:
123456789#include<stdio.h>void main(){ char a[100]="wel",b[]="come";//数字长度要长一点,否则是根据后面字符串长度来定义数组的 int i,n=0; while(a[n])n++;//条件正好反了,所以!去掉就能连接字符串了 for(i=0;b[i]!='\0';i++)a[n+i]=b[i]; a[n+i]='\0'; printf("%s\n",a);}追问

确定是一道题吗= =

温馨提示:答案为网友推荐,仅供参考
相似回答
大家正在搜