   refresh my memory, c++ inheritance
  struct object{ int method();};class robot : public object{ int method();};int robot::method(...){ object::method(...); //does this do what i think it does?  ((object*)this)->method(...); //this maybe?  //do more stuff}   
  what do you think it does?   ;  You have to declare the method as virtual:struct object{ virtual int method();};class robot : public object{ int method();};int robot::method(...){ object::method(...); // this calls the object version of method((object*)this)->method(...); //this would call robot::method (and would result in infinite recursion here);  it seems to work for me without declaring it as virtual. is there a good reason to use virtual anyway?   ;  Without declaring it virtual ptr->method() will always call the method of static (compile-time) type, that is:- if the pointer is Derived* - you will call Derived::method(),- if the pointer is Base* - you will call Base::method().If you declare the method as virtual, ptr->method() will call the method of dynamic (run-time) type, that is:- if the pointer is Base* or Derived* and object is Derived -- you will call Derived::method(),- otherwise - you will call Base::method().   ;You're on the right track. (See also sections above and below that)   