Lecture overview -- Keyboard shortcut: 'u'  Previous page: Operator overloading -- Keyboard shortcut: 'p'    Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Alphabetic index  Help page about these notes  Course home    Abstraction Mechanisms, Part 1 - slide 36 : 36

Example: Operator overloading in class Point

We program a few funny Point operators: ++, +, and ==

Both as members and as friends

point.h
Class Point with operators as members.
point.cc
Definition of Point member functions.
prog.cc
A program that illustrates uses the Point operators.
program-output
Program output.
point.h
Class Point with non-member operators.
point.cc
Definition of Point member functions and non-member operators.
prog.cc
An identical program that illustrates uses the Point operators.
program-output
Program output.