Playing around with Inheritance in C++