Hello everyone,
I am using native C++ with VSTS 2008. A quick question about virtual function. In my sample below, any differences if I declare Foo as "virtual void Foo()" or "void Foo()" in class Derived? Any impact to any future classes which will derive from class Derived?
class Base
{
public:
Base()
{
}
virtual void Foo()
{
cout << "In base" << endl;
}
};
class Derived : public Base
{
public:
Derived()
{
}
void Foo()
{
cout << "In derived " << endl;
}
};
thanks in advance, George