To the down-voters: I understand that this was a poorly constructed question. If you'll scroll down to the answers, you'll see that I discovered the source of the problem. While the question itself might not be helpful, I hope the answer will help somebody experiencing similar trouble with operator overloading. The problem was what it was; I cannot identify any edits or revisions that would make this a better question. Therefore, if you're going to submit a down-vote, please add a constructive comment as well. Thank you.
I'm running the following code
myObject o = myObject();
cout << o << endl;
My (friend
) << operator is overloaded here:
ostream& operator << (ostream& s, myObject o)
{
s << doStuff(o, s) << endl;
return s;
}
Expected output:
object contents
Actual output is, for some reason, including the memory address:
5452ED48object contents
Why?