#include <stdio.h>
#include<string.h>
int main() {
char greeting[7] = { 'h','e','l','l','o','\0' };
char *str = "helloaf;af;";
printf("%s\n",greeting);
printf("%d\n", sizeof(greeting));//7
printf("%d\n",strlen(greeting));//5
printf("%s\n",str);
printf("%d\n",sizeof(str));//4
char str1[12] = "hello";
char str2[12] = "world";
char str3[12];
int len;
int cmp;
//比较
cmp = strcmp(str1, str2);
printf("strcmp(str1,str2):%d\n",cmp);
//复制str1到str3
strcpy(str3,str1);
printf("strcpy(str3,st1):%s\n",str3);
//连接str1和str2
strcat(str1,str2);
printf("strcat(str1,str2):%s\n",str1);
//计算长度
len = strlen(str1);
printf("strlen(str1):%d\n",strlen(str1));
return 0;
}