I use native C ++ with VSTS 2008. Quick question about virtual function. In my example below, any differences if I declare Foo as "virtual void Foo ()" or "void Foo ()" in the Derived class? Any influence on any future classes that will be derived from the Derived class?
class Base { public: Base() { } virtual void Foo() { cout << "In base" << endl; } }; class Derived : public Base { public: Derived() { } void Foo() { cout << "In derived " << endl; } };
source share