如果是string类直接想加就可以了str1+str2;
如果是char类,需要调用函数strcat,如strcat(ch1,ch2)
#include
void main()
{char s1[80],s2[40];
int i=0,j=0;
printf("\ninput string1:");
scanf("%s",s1);
printf("input string2:");
scanf("%s",s2);
while(s1[i]!='\0')
i++;
while(s2[j]!='\0')
s1[i++]=s2[j++];
s1[i]='\0';
printf("The new string is:%s\n",s1);
}