请帮忙看下这里的指针怎么不对??
#include <iostream.h>
#include <windows.h>
void CHstring(char * st1,char * st2) //按地址传递结构体参数
{
while (*st1++ && *st2++)
{
if ( int(*st1)==32)
*st2=*st1;
else
*st2=char((int)*st1+1);
}
}
void main()
{
char p1[]="zwzwzwzwzwzw";//<<=====为什么改为char *p1="zhangzhiwei";就不对?!!
char p2[]="xieliping";//<<======== char *p2="xieliping";
cout<<p1<<" "<<(int *)p1<<endl;
cout<<p2<<" "<<(int *)p2<<endl;
CHstring(p1,p2);
cout<<p1<<" "<<(int *)p1<<endl;
cout<<p2<<" "<<(int *)p2<<endl;
}