I was reading recent discussion threads and found something interesting that someone introduced as a question, but instead of start developing the whole story from here, I’ll just challenge you with two different quiz games.
Without using Visual Studio or your building tool of preference, just your knowledge, if we tried to run this code, what is expected to see in the console? Why?
Now let’s make a little variation and substitute the method getting no arguments for one getting char, as follows:
If we ran this new version, provided that it compiles with no errors, what is expected to be seen in the output console? Why?
Solutions are explained in this sequel.
Overloading would be less confusing if it were called Obfuscation instead.
My guess (since there seems to be a few guesses going on)
Quiz 1: "Baz::DoStuff()"
Quiz 2: "Baz::DoStuff(char)"
This appears to be the intention, and it is the pure virtual nature of the methods of both FOO and BAR which causes the child classes to be called.
This is assuming there isn't a compiler error when BAR doesn't override DoStuff() in Quiz 1, or DoStuff(char) in Quiz 2.