Lecture 3 - Slide 6 : 27
Examples of casting

A number of concrete illustrations of casting in C++

casts1.cc
Examples of static casting in C++.
casts1-compilable.cc
The compilable parts of the program from above.
casts2.cc
Example of dynamic casting in C++.
casts2-compilable.cc
The compilable parts of the program from above.
casts3.cc
dynamic_cast is a predicate - it tests if a pointer is of the appropriate type.
casts4.cc
Examples of reinterpret_cast.
casts4-compilable.cc
The compilable parts of the program from above.