#include<iostream.h>
void scat(char *p1,char*p2)
{
while(*p1!=0)
p1++;
while(*p2!=0)
*p1++=*p2++;
}
void main()
{
char s1[40],s2[20];
cout<<"Input String1:";
cin>>s1;
cout<<"Input String2:";
cin>>s2;
scat(s1,s2);
cout<<"String1+String2="<<s1<<endl;
}
字符串的连接
最新推荐文章于 2021-12-22 21:24:45 发布