在C中,可以在声明中使用字符串文字,如下所示:
char s[] = "hello";
或者像这样:
char *s = "hello";
那么区别是什么呢?我想知道在编译和运行时的存储持续时间实际发生了什么.
c string constants char
c ×1
char ×1
constants ×1
string ×1