Virtual Inheritance Confusion
- by alan
I'm reading about inheritance and I have a major issue that I haven't been able to solve for hours:
Given a class Bar is a class with virtual functions,
class Bar
{
virtual void Cook();
}
What is the different between:
class Foo : public Bar
{
virtual void Cook();
}
and
class Foo : public virtual Bar
{
virtual void Cook();
}
? Hours of Googling and reading came up with lots of information about its uses, but none actually tell me what the difference between the two are, and just confuse me more.
Thanks!