0

When overloading the insertion operator (operator<<) in order to insert an object (say a shae) into an output stream (file or console), we had to implement it as a global function. why was this? Could someone show me an example prototype for this function for inserting a shape into an ostream object? How is this different than having this operator as a member of our class(like a shape)?

n. Doe
  • 1
  • 1
  • 6

0 Answers0