| Lecture 4 - Slide 36 : 40 |
We wish that the overloaded operator<< for class Point is a friend
This particular operator cannot be defined as a member of class Point, because the point is the second operand
It is, in general, attractive that this and other operators get access to the private state of the class
Class Point - header file. |
Class Point - implementation - including the implementation of operator<<. |
The program that uses the operator - nothing new here. |