【发布时间】:2013-03-27 10:13:20
【问题描述】:
我对以下陈述有疑问;
int intvalue = 3;
int *pointInt = &intvalue;
char* p = "string";
cout << pointInt << std::endl; // this will give memory location of intvalue which is ok.
cout << p<< std::endl; // why this will give string value rather than memory location of where string is stored?
【问题讨论】:
-
由于运算符重载
<< -
我编辑了标题;问题是关于
char*,而不是指向char*的指针。