Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Scene {
- private:
- public:
- virtual void update() = 0;
- virtual void draw() = 0;
- virtual void start() = 0;
- };
- class Ben10 {
- private:
- public:
- virtual void Shout() { cout << "Mere Mortal" << endl; }
- };
- class Heatblast : public Ben10 {
- private:
- public:
- void Shout() { cout << "I'm super hot" << endl; }
- void shootLaser() { cout << "Laser" << endl; }
- };
- class Wildmutt : public Ben10 {
- private:
- public:
- void Shout() { cout << "I walk on 4 legs" << endl; }
- };
- class FourArms : public Ben10 {
- private:
- public:
- void Shout() { cout << "I have Four Arms" << endl; }
- };
- int main() {
- Ben10* arr[5];
- arr[0] = new Heatblast();
- arr[1] = new Wildmutt();
- arr[2] = new FourArms();
- arr[3] = new Ben10();
- /*arr[0].Shout();
- arr[1].Shout();
- arr[2].Shout();
- arr[3].Shout();*/
- arr[0]->Shout();
- arr[1]->Shout();
- arr[2]->Shout();
- arr[3]->Shout();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement