#include <iostream>
using namespace std;
char *stringcat(char *source,const char*dest);
int main(){
char s1[30]="I love";
char *s2="C++";
stringcat(s1,s2);
cout<<s1<<endl;
return 0;
}
char *stringcat(char *source,const char*dest){
int i=0;
while(*(source+i)!='\0'){
i=i++;
}
int n=0;
while(*(dest+n)!='\0'){
*(source+i)=*(dest+n);
n++;
i++;
}
return source;
}
项目一连接字符串
最新推荐文章于 2024-06-25 18:04:55 发布