Lecture overview -- Keyboard shortcut: 'u'  Previous page: Implicit Conversion -- Keyboard shortcut: 'p'  Next page: Static class members -- 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 20 : 36

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
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