Read the C++ FAQs regarding inheritance, especially the ones regarding proper inheritance and substitutability, otherwise you'll be back here in a few days asking how to use dynamic_cast. Inheritance is more than just re-using functions and data, but unfortunately it is often abused.