Lecture 4 - Slide 24 : 40
Classes and Conversion: Examples
Illustrates conversion between a built-in type and a user defined type: double and Point
point1.h
Class Point with conversion constructor and conversion operator, from and to double.
point1.cc
Class Point implementation.
prog1.cc
Use implicit of the conversions.
prog1-output
Program output.

The following illustrates conversion between user-defined types: Point and Tripple

For the exercise below

point1.h
Class Tripple with Tripple(Point) constructor and a Point conversion operator.
point1.cc
Class Tripple implementation.
prog1.cc
Illustration of conversions.
prog1-output
Program output.
Go to exercise
Conversion via constructors