【发布时间】:2012-03-10 05:49:35
【问题描述】:
可能重复:
Sizeof doesn't return the true size of variable in C
C -> sizeof string is always 8
Sizeof 打印出 6 个:
printf("%d\n", sizeof("abcde"));
但它打印出 4 用于:
char* str = "abcde";
printf("%d\n", sizeof(str));
谁能解释一下原因?
【问题讨论】: