![]() |
#2
laoyang1032010-11-30 15:55
|
程序——
#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。
哪位高手能给指点一下。谢谢!