Here\'s what I\'m trying to do (this code doesn\'t work):
class Base { virtual Base *clone() { return new Base(this); } virtual void ID() { printf(\"
You're slicing the class in Base bp = &d; (this constructs a new base bp from the derived-ptr.)
Base bp = &d;
Try Base* bp = &d; instead. (i.e. create a pointer of Base type to the Derived object.)
Base* bp = &d;