Recall that in order to reserve space in memory (for example for an array whose size only becomes known at run-time of your program) we use the function malloc() whose prototype is
Here, size is the total amount of space you need for your data. For example, if you wanted to store 10 structures of type point_t you’d need space in the amount of 10*sizeof(point_t).
Write a function createPolygon() to which you can pass an integer and that reserves space in memory for an array of points of that size and returns a pointer to that array. Just to be on the safe side, have this function also initialize all coordinates to (0.0,0.0).