Lecture 4 - Slide 40 : 40
Example: Operator overloading in class Point
We program a few funny
Point
operators:
++
,
+
, and
==
Both as
members
and as
friends
Class Point with operators as members.
Definition of Point member functions.
A program that illustrates uses the Point operators.
Program output.
Class Point with non-member operators.
Definition of Point member functions and non-member operators.
An identical program that illustrates uses the Point operators.
Program output.