Question OOP-ABS-0062
HardWhat is the output of this code?
#include <iostream>
using namespace std;
class Base {
public:
virtual void run() = 0;
};
void Base::run() { cout << "base-run "; }
class Impl : public Base {
public:
void run() override { Base::run(); cout << "impl-run"; }
};
int main() {
Impl i;
i.run();
}
- A.
Compilation error
- B.
base-run
- C.
Sign up free to see the answer and a step-by-step explanation.