#include #include "graphics.h" int main() { struct gobject * objects[10]; int i; for(int i = 0; i < 10; ++i) { if (i % 3) { objects[i] = (struct gobject *)point_new(i*2, i*3 - 10); } else { objects[i] = (struct gobject *)rectangle_new(i*2, i*3, i*4, i*5); } } for(int i = 0; i < 10; ++i) { printf("%d: ", i); gobject_virtual_print(objects[i]); printf("area: %f\n", gobject_virtual_area(objects[i])); } for(int i = 0; i < 10; ++i) gobject_virtual_destroy(objects[i]); }