Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class A
- {
- public:
- A(){};
- void virtual move()=0;
- };
- class B1: public A
- {
- public:
- B1(){};
- void virtual move(){
- cout<<2<<endl;
- }
- };
- class B3: public A
- {
- public:
- B3(){};
- void virtual move(){
- cout<<3<<endl;
- }
- };
- int main()
- {
- A* t;
- t = new A;
- t->move();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement