C++ Abstract class

  c++

Email

#include<iostream>

using namespace std;

class Shape{

public:

virtual void drow()=0;

};

class Rete : Shape{

public :

void drow()
{
cout << “this main regtagularn”;

}
};

class Treal : Shape{

public:
void drow()
{

cout << “this other shape of the comptern”;
}
};

class Book : Shape{

public :
void drow()
{

cout <<“this values of the bookingn”;
}
};

int main()
{

Rete rec;

rec.drow();
Treal tech;
tech.drow();
Book d;
d.drow();

}

Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of