问题
After a long day of coding i accidentaly wrote
cout << "some text" << cout;
instead of
cout << "some text" << endl;
Now it printed out a memory address. What does it point to ?
回答1:
std::cout is an instance of std::ostream, and, before C++11, that had a conversion operator to void*. It seems your code is triggering that conversion, giving you the address of the std::cout object.
来源:https://stackoverflow.com/questions/28872624/cout-cout-what-does-the-output-stand-for