#include #include #include #define SHAPE_TYPE 3 #define PACK 3 typedef struct { int x,y; }POINT; typedef struct { POINT poligon[SHAPE_TYPE]; int length [SHAPE_TYPE]; }POLIGON; typedef struct { POLIGON* poly; }RECORD; //===================// RECORD* Add(RECORD* rec); //====================// main () { int choise; RECORD* rec=(RECORD*)malloc(10*sizeof(RECORD*)); printf("\nPlease Select from the menu:\n\n1.\tADD RECORD\n2.\tMODIFY RECORD\n3.\tDISPLAY RECORD\n4.\tDISPLAY ALL RECORDS\n5.\tSORT\n6.\tSearch Highest POINT\n0.\tQUIT\n\n"); fflush(stdin); scanf("%d",&choise); switch (choise) { case 0: { exit(2); } break; case 1 : { rec = Add(rec); } break; case 2 : { } break; case 3 : { } break; case 4 : { } break; case 5 : { } break; case 6: { } break; } free(rec); } RECORD* Add(RECORD* rec) { int i,*size=0; //POLIGON* poly; //rec= (RECORD*)malloc((1)*sizeof(RECORD)); rec->poly=(POLIGON*)realloc(rec->poly,2*sizeof(POLIGON)); for(i=0;iPoint %d:\n", (i+1)); fflush(stdin); scanf("%d %d",&(rec->poly->poligon[i].x),&(rec->poly->poligon[i].y)); } }