diff options
Rename Polymorphism/main.cpp to Polymorphism/Figures/main.cpp
1 files changed, 20 insertions, 0 deletions
| -rw-r--r-- | Polymorphism/Figures/main.cpp | 20 |
diff --git a/Polymorphism/Figures/main.cpp b/Polymorphism/Figures/main.cpp new file mode 100644 index 0000000..39336c3 --- /dev/null +++ b/Polymorphism/Figures/main.cpp @@ -0,0 +1,20 @@ +#include "Figure.h"
+
+
+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;
+ }
+
+
+}
+
+
|
