Zoo tutorials: [ SQL | Linux | XML ]
ProgZoo: [ Java | C# | VB | C++ | Perl ]
Log in

A Gentle Introduction to
C++ Programming

Casting

 

Data types

Casting

We sometimes need to cast from one class to another. We can only cast up or down the class hierarchy. As Object is at the top of the class hierarchy we can always cast to an object.

Casting down the hierarchy may result in a run time error.