Array of Point Arrays

  • Thread starter Thread starter jerry chapman
  • Start date Start date
J

jerry chapman

I have created an Array of Point Arrays.

Point[][] myPolygons;
myPolygons[0]=new Point[30];

What is the syntax for entering the 30 points into myPolygons[0]?
 
Point[][] myPolygons;
myPolygons[0]=new Point[30];

You can change the second line to the following:

myPolygons[0] = new Point[] { new Point(0, 1), new Point(0, 2), etc... };

Or, you can loop through them:

--
Dave Sexton
[email protected]
-----------------------------------------------------------------------
jerry chapman said:
I have created an Array of Point Arrays.

Point[][] myPolygons;
myPolygons[0]=new Point[30];

What is the syntax for entering the 30 points into myPolygons[0]?
 
jerry chapman said:
I have created an Array of Point Arrays.

Point[][] myPolygons;
myPolygons[0]=new Point[30];

What is the syntax for entering the 30 points into myPolygons[0]?

for (int i=0; i < 30; i++)
{
myPolygons[0] = new Point(...);
}
 
Back
Top