#include<iostream> class Base { public: virtual void f() { std::cout << "Base"; } }; class Child : public Base { public: int f() { std::cout << "Child"; } }; int main() { Child c; c.f(); }
f()
Base
Child
Login in to like
Login in to comment
or Read more about C++ Quizzes
Login in to like
Login in to comment