字符串变量首地址问题
[code]#include<iostream>#include<string>
#include<cstdlib>
using namespace std;
int main()
{
string a = "long";
cout << &a << endl;
cout << (void*)&a[0];
system("pause");
return 0;
}
输出结果:003FF988
003FF98C
问题:为什么&a与&a[0]不一样呢?
2015-06-28 16:33
2015-06-28 16:45
2015-06-28 17:14
2015-06-28 20:12

2015-06-28 20:38
2015-06-28 20:51

2015-06-29 09:53
2015-06-29 10:25
2015-06-29 10:29
2015-06-29 16:09