writer << "some text\n";
writer << 1234;
Notice how 1234 is a const int, so how does that work?
Just curious is all [wink]
interesting ostream question
After reading this page about operator<< for ostreams, I noticed that there aren't any overloads for const references.
So how then does an ostream handle code like this?:
Simple. The page you linked to is wrong. The insertion operator for an ostream takes an int argument not an int reference.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement