Lecture overview -- Keyboard shortcut: 'u'  Previous page: Friends - class Point - notational convenience -- Keyboard shortcut: 'p'  Next page: Friends - Class Point - implicit conversion -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Abstraction Mechanisms, Part 1 - slide 32 : 36

Friends - Class Point - operator friends

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

point.h
Class Point - header file.
point.cc
Class Point - implementation - including the implementation of operator<<.
prog.cc
The program that uses the operator - nothing new here.