469,613 Members | 1,331 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

Array of Point Arrays

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]?
Nov 17 '05 #1
2 5290
> 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
dave@www..jwaonline..com
-----------------------------------------------------------------------
"jerry chapman" <je*******@sbcglobal.net> wrote in message news:su*****************@newssvr21.news.prodigy.co m...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]?

Nov 17 '05 #2
jerry chapman <je*******@sbcglobal.net> wrote:
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][i] = new Point(...);
}

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Linny | last post: by
7 posts views Thread by simkn | last post: by
204 posts views Thread by Alexei A. Frounze | last post: by
104 posts views Thread by Leszek | last post: by
24 posts views Thread by Michael | last post: by
17 posts views Thread by =?Utf-8?B?U2hhcm9u?= | last post: by
45 posts views Thread by anto frank | last post: by
4 posts views Thread by Edward Jensen | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.