#include
#include
void catstring(char *str0, int len0, char *str1, int len1, char *str2, int len2)
{
if (len2 <= len0 + len1) {
return;
}
memcpy(str2, str0, len0);
memcpy(str2 + len0, str1, len1);
}
int main()
{
char str0[20] = "Golden";
char str1[20] = "View";
char str2[20] = { 0 };
catstring(str0, strlen(str0), str1, strlen(str1), str2, 20);
printf("str2 = %s\n", str2);
return 0;
}
请采纳,谢谢!