#include <stdio.h><stdlib.h>
Interface struct
Class struct
shape* Shape( shape_getEdges(shape * shape_getArea( _Shape(shape *
triangle * Triangle( bottom, triangle_getEdges(triangle * triangle_getArea(triangle * _Triangle(triangle *
rectangle * Rectangle( bottom, rectangle_getEdges(rectangle * rectangle_getArea(rectangle * _Rectangle(rectangle *
(*getEdges)(shape* (*getArea)(
shape* Shape(* obj = (shape *) malloc(->edges =->getEdges =->getArea = shape_getEdges(shape* obj-> shape_getArea( -
_Shape(shape *(obj ==
* (*getEdges)(triangle * (*getArea)(triangle *
triangle * Triangle( bottom, * obj = (triangle*) malloc(
obj->super = Shape(->bottom =->height =->getEdges =->getArea = triangle_getEdges(triangle * obj->super-> triangle_getArea(triangle * (obj->bottom * obj->height) /
_Triangle(triangle *->(triangle ==
* (*getEdges)(rectangle * (*getArea)(rectangle *
rectangle * Rectangle( bottom, * obj = (rectangle *)malloc(
obj->super = Shape(->bottom =->height =->getEdges =->getArea = rectangle_getEdges(rectangle * obj->super-> rectangle_getArea(rectangle * (obj->bottom * obj->
_Rectangle(rectangle *->(obj ==
* shapeObj = Shape(, shapeObj->, shapeObj->* triangleObj = Triangle(, , triangleObj->, triangleObj->* rectangleObj = Rectangle(, , rectangleObj->, rectangleObj->