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 and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 3 - Page 32 : 36
Notes about C++
Abstraction Mechanisms, Part 1
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

y:/Kurt/Files/Advanced-programming-cpp/cpp/kn/friends/point-with-operator-friend/point.hClass Point - header file.


y:/Kurt/Files/Advanced-programming-cpp/cpp/kn/friends/point-with-operator-friend/point.ccClass Point - implementation - including the implementation of operator<<.


y:/Kurt/Files/Advanced-programming-cpp/cpp/kn/friends/point-with-operator-friend/prog.ccThe program that uses the operator - nothing new here.