What is the output of the following program?
#includeusing namespace std;class Base {public: void f() { cout<> }};class Derived:public Base {public: void f() { cout<> }};main() { Derived obj; obj.Base::f();}A - BaseB - DerivedC - Compile errorD - None of the above.
using namespace std;
class Base {
public:
void f() {
cout<>
}
};
class Derived:public Base {
main() {
Derived obj;
obj.Base::f();
A - Base
B - Derived
C - Compile error
D - None of the above.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here