#include <stdio.h>#include <string.h>
int main() {char str1[20] = “Hello”;char str2[20] = “World”;
// 将str2拼接到str1的末尾strcat(str1, str2);printf("str1 after concatenation: %s\n", str1);// 比较str1和str2int result = strcmp(str1, str2);if (result == 0) { printf("str1 and str2 are equal\n");} else if (result < 0) { printf("str1 is less than str2\n");} else { printf("str1 is greater than str2\n");}// 复制str1到str2strcpy(str2, str1);printf("str2 after copying: %s\n", str2);return 0;}


