Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Figures / main.cpp
blob: 2b4eb2346a73e017cad3ba5d515881b729fd6c9d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

#include "Figure.hpp"
#include "Triangle.hpp"
#include "Rectangle.hpp"
#include "Circle.hpp"


int main()
{
	Figure** arr= new Figure*[3];
	arr[0] = new Triangle(15, 15, 15, 30, 50, 30);
	arr[1] = new Rectangle(15, 15, 50, 30);
	arr[2] = new Circle(1, 2, 9);

	for (int i = 0; i < 3; i++)
	{
	    cout << arr[i]->getPer()<<endl;
		cout << arr[i]->getArea()<<endl;
	}


}