Help with arrays as parameters

edited*
Last edited on
28
29
30
   Point points[20];
   double x_array[20];
   double y_array[20];
Choose one or the other, not both. Probably you want to keep line 28 and erase lines 29 and 30.
Last edited on
Perhaps I'm missing something, but you have an array of points in the Polygon class which holds each x,y value. So why store the coordinates again in x_array and y_array?

Seems to me the code in Setpoints() should look like the constructor w/params.

And in showPolygon() just iterate over points[] and call Point::showPoint().
Topic archived. No new replies allowed.