#include <stdio.h> #include <stdlib.h> int main() { const char *pt = "abcdef"; /* 1.abcdef字符串字面量对象 2.字符数组对象(单个元素也是对象) 3.标识符为pt的对象,存储字符串的地址 const 修饰的是字符串字面量对象和字符数组对象,也就是他们的内容不能被修改 但是pt对象的内容是可以修改的 */ //修改pt对象的内容 printf("%p\n", pt ); char ch = ‘a‘; pt = &ch; printf("%p\n", pt); return 0; }
原文:https://www.cnblogs.com/bajiaotai/p/14992328.html