char *p="hua";这样赋值,p指向常量区(也就是字符串常量hua的首地址),对于常量指针不能进行赋值处理,所以*p=*(p+1); //这句错了改成:char p[]="hua";就OK了:#includevoid main(){ char ch='*',bh='%'; char *s="JKJ"; char p[]="hua";cout<<*(p+1)< cout<<*p< *p=*(p+1); cout<}
}