I create a parent class that calls it's own virtual member. But this virtual member is overridden by child class.
class Parent {
public:
void doSomething() {
doVirtual();
}
protected:
virtual void doVirtual() {}
};
class Child : public Parent {
protected:
virtual void doVirtual() {}
};
Parent *c = new Child();
c->doSomething();
And compile it with visual studio 2008, my question is: When i execute code from IDE (start debugging), it calls child method, but when i run executable directly, it calls parent method. Am i doing something wrong here?