Given the following code:
class B {
public:
virtualvoid foo();
};
void B::foo() { cout << "B"; }
class D : public B {
public:
virtualvoid foo() {
B::foo(); cout << "D";
}
};
int main() {
B b;
B *pB = &b;
pB->foo();
return 0;
}
If this code is compilable, what is the output? Type NC if it is not compilable.
B