Array of Point Arrays

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]?
 
D

Dave

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]?
 
J

Jon Skeet [C# MVP]

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(...);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top