```c++
#include
int main()
{
char str[]{ "123456" };
std::cout << str;
system("pause");
}
这条代码里,输出str后,得到的为什么是123456呢,为什么不是一个地址?? 这里应该是把123456储存道了str中把
```
cout 会将 字符数组的首地址指向的数据输出,直到遇到 结束符 ‘\0’
这个才是输出 str 对应的首地址的 地址数据
cout << &str;
print输出地址用%p。
cout的<<根据输出变量类型使用不同的方法输出。这里str是个字符串,因此输出123456。