字符串:为什么这样操作指针得不到需要的结果
![](zzz/editor/img/code.gif)
char *p, *strText = "123456789"; p = strText; printf("1:p=%s strText=%s\n", p, strText);//输出:123456789 p[3] = '\0'; printf("2:p=%s strText=%s\n", p, strText);//输出:123 strText[3] = '\0'; printf("3:p=%s strText=%s\n", p, strText);//输出:123
![](http://bbs_bccn_net.bccnsoft.com/006/month_1612/20161202_6162e23079938c3f99deZpqdrH3wIrvn.jpg)