字符链接
#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)
{ char *p=source;
for(int i=0;i<7;i++)
source++;
for(i=0;i<3;i++)
{*source=*dest;
source++;
dest++;
}
return p;
}