字符串和数组的区别,长度、所占空间计算和比较
char str1[10]={"helllo"}; char str2[10]={'h','e','l','l','o'}; char str3[]={"hello"}; char str4[]={'h','e','l','l','o'}; printf("sizeof(str1):%d strlen(str1):%d\n",sizeof(str1),strlen(str1)); printf("sizeof(str2):%d strlen(str2):%d\n",sizeof(.
原创
2020-06-11 22:03:16 ·
3646 阅读 ·
0 评论