char ch1[] = "hello";
char ch2[] = { "hello" };
char ch3[] = { 'h','e','l','l','o' };
char ch4[5] = { 'h','e','l','l','o' };
char ch5[6] = { 'h','e','l','l','o' };
char ch6[] = { 'h','e','l','l','o','\0' };
printf("size=%d\tch1=%s\n", sizeof(ch1), ch1);
printf("size=%d\tch2=%s\n", sizeof(ch2), ch2);
printf("size=%d\tch3=%s\n", sizeof(ch3), ch3);
printf("size=%d\tch4=%s\n", sizeof(ch4), ch4);
printf("size=%d\tch5=%s\n", sizeof(ch5), ch5);
printf("size=%d\tch6=%s\n", sizeof(ch6), ch6);
运行截图