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