为什么地址相差4
程序——#include<iostream>
using namespace std;
void main()
{
char str[]={"hello!"};
char *p=str;
cout<<p<<endl;
cout<<str<<endl;
cout<<&p<<endl;
cout<<&str<<endl;
}
p和str输出结果一致,为hello!
可&p和&str的输出结果却相差4。
哪位高手能给指点一下。谢谢!
2010-11-30 15:20
如果觉得可以给我点分

2010-11-30 15:55

2010-11-30 17:02
2010-11-30 17:32
2010-12-01 13:18
2010-12-01 16:39
2010-12-03 16:11
2010-12-03 16:15