char source[] = "Hello";
char destination[10];
strcpy(destination, source);
char str1[20] = "Hello";
char str2[] = "World";
strcat(str1, str2);
char str[] = "Hello";
int length = strlen(str);
char str1[] = "Hello";
char str2[] = "Hello";
int result = strcmp(str1, str2);
char str[] = "Hello";
char *ptr = strchr(str, 'e');
if (ptr != NULL) {
printf("Character 'e' found at position: %d\n", ptr - str);
}
这些都是C语言中常用的字符串函数的例子,它们可以帮助处理和操作字符串。