>
Computer Science
List of top Computer Science Questions on C++ Virtual Functions and Static Binding
What is the output of the following C++ code?
# include <iostream.h>
class Base {
public:
void show() {cout << "Base"; }
};
class Derived : public Base {
public:
void show() {cout << "Derived"; }
};
int main() {
Base* b = new Derived();
b->show();
}
CPET - 2025
CPET
Computer Science
C++ Virtual Functions and Static Binding