#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char* Strcat(char* str1, const char* str2) {
int n = strlen(str1);
int i = 0;
while (str1++[i + n] = str2++[i]);
return str1;
}
void main() {
char str1[256] = "abcd";
char str2[256] = "efgh";
printf("字符串1:%s\n", str1);
printf("字符串2:%s\n", str2);
Strcat(str1, str2);
printf("连接后字符串:%s\n", str1);
system("pause");
}
版权声明:本文为qq_41071068原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。