Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class First
- {
- public:
- First()
- {
- }
- void Update(void)
- {
- A();
- }
- virtual void A(void)
- {
- std::cout << "First::A";
- }
- };
- class Two : public First
- {
- public:
- Two () : First () {};
- void A(void)
- {
- std::cout << "Two::A";
- }
- };
- int main()
- {
- Two *T = new Two;
- T -> Update();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment