Joined: Sun Oct 19, 2008 3:47 pm Posts: 281 Has thanked: 0 time Have thanks: 1 time
I've been doing some operator overloading and i've pretty much covered the whole thing, except the insertion and extraction operators.
I've got two questions: 1. I've seen in my book as well as many sites on line that those two operators can only be overloaded using friend functions. Can't we use member functions instead? I've tried doing it... but didn't up come with a way of refering to streams inside the function...
2. The two operators (<< and >>) are binary operators. By obvious logic, the function of the overloaded binary operator should always return a value. for the operators << and >> where is this value returned to.