Remember these are potential/possible Job-Interview Questions, so
no googling, running it in your compiler etc. Pretend like you're in a conference room with nothing but a white board....
If you don't know the answer, you can simply say so or try to write out what you think it is...
This one is a 3 parter:
A) What is a pure virtual Function?
B)Consider the following code:
Code:
#include <iostream>
using namespace std;
Class A
{
public:
A() { this->Foo(); }
virtual void Foo() { cout << "A::Foo()" << endl; }
};
Class B : public A
{
public:
B() { this->Foo(); }
virtual void Foo() { cout << "B::Foo()" << endl; }
};
int main(int, char**)
{
B ObjectB;
return 0;
}
C)What output would it generate if you make A::Foo() a pure virtual function?