1 #include <stdio.h> 2 3 int main(void) 4 { 5 char a[] = "hello"; //字符串以字符串数组的形式保存,末尾加上'\n' 6 printf("%d\n", sizeof(a)); 7 8 for (int i = 0; i < sizeof(a); i++) 9 { 10 printf("%c", a[i]); 11 } 12 printf("end\n"); 13 14 return 0; 15 }