char name
[] = "it";
name
[0] = 'T';
printf("name = %s\n",name
);
char *name2
= "it";
printf("name = %s\n",name2
);
char *names
[5] = {"jack","rose","jake"};
char names2
[2][10] = {"jack","rose"};
补充内容:
1.栈: 存放函数内的局部变量,形参和函数返回值 2.堆: 对象 3.静态区(全局区): 4.常量区: 存放一些常量字符串,常量区的内容无法修改,而且会缓存起来,如果下次又用到了,会返回同一个常量 5.代码区
转载请注明原文地址:https://tech.qufami.com/read-12260.html