#include <iostream> using namespace std; struct B { void f() { cout << "B"; } }; struct C: B { void f() { cout << "C"; } }; int main() { C c; B *b1 = &c; b1->f(); B b2 = c; b2.f(); return 0; }
Login in to like
Login in to comment
or Read more about C++ Quizzes
Login in to like
Login in to comment