Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- struct A
- {
- virtual void execute() { std::cout << "Parent\n"; }
- };
- struct B : public A
- {
- void execute() { std::cout << "Child\n"; }
- };
- int main()
- {
- A* a = new B;
- a->execute();
- a->A::execute();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement