S
Sue & Bill
I have:
Rectangle[] rects = new Rectangle[10000];
I want to initialize the values of rects as follows:
Option A:
========
for (int i=0; i<rects.Length; i++)
{
rects.X = 0;
rects.Y = 0;
rects.Size.Width = 100;
rects.Size.Height = 20;
}
(By the way, rects.Size.Width = 100 above generates a compiler
error. I haven't figured out why.)
What is the impact on memory or performance, if any, if I use the
following instead:
Option B:
========
for (int i=0; i<rects.Length; i++)
rects=new Rectangle(new Point(0,0), new Size(100,20));
Option C:
========
for (int i=0; i<rects.Length; i++)
{
rects.Location = new Point(0,0);
rects.Size = new Size(100,20);
}
Thank you for your help.
Rectangle[] rects = new Rectangle[10000];
I want to initialize the values of rects as follows:
Option A:
========
for (int i=0; i<rects.Length; i++)
{
rects.X = 0;
rects.Y = 0;
rects.Size.Width = 100;
rects.Size.Height = 20;
}
(By the way, rects.Size.Width = 100 above generates a compiler
error. I haven't figured out why.)
What is the impact on memory or performance, if any, if I use the
following instead:
Option B:
========
for (int i=0; i<rects.Length; i++)
rects=new Rectangle(new Point(0,0), new Size(100,20));
Option C:
========
for (int i=0; i<rects.Length; i++)
{
rects.Location = new Point(0,0);
rects.Size = new Size(100,20);
}
Thank you for your help.