指针测试出错!
# include<iostream.h>//测试指针,
void main()
{
char s[]="hello"; //测试s,&s,&s[0],*s,的区别;
char* ps1=s;
char* ps2=&s[0];
char(* ps3)[6]=&s;
char* ps4=&s[4];
*ps4=*s;
cout<<*ps1<<endl;
cout<<*ps2<<endl;
cout<<*ps3<<endl;//为何输出的是"hellh"而不是"hello"呢?
cout<<*ps4<<endl;
}