class Program
{
static void Main(string[] args)
{
Point[] ArrPoint = new Point[30];
for (int i = 0; i < 30; i++)
{
ArrPoint[i].X = i;
ArrPoint[i].Y = i * 2;//任意赋值的!
}
Point p = GetPoint(3,ref ArrPoint);
Console.WriteLine(p.X.ToString() + ", "+p.Y.ToString());
}
static Point GetPoint(int index,ref Point[] ArrPoint)
{
Point p = new Point();
if (index < ArrPoint.Length)
{
p= ArrPoint[index];
}
return p;
}
}
{
static void Main(string[] args)
{
Point[] ArrPoint = new Point[30];
for (int i = 0; i < 30; i++)
{
ArrPoint[i].X = i;
ArrPoint[i].Y = i * 2;//任意赋值的!
}
Point p = GetPoint(3,ref ArrPoint);
Console.WriteLine(p.X.ToString() + ", "+p.Y.ToString());
}
static Point GetPoint(int index,ref Point[] ArrPoint)
{
Point p = new Point();
if (index < ArrPoint.Length)
{
p= ArrPoint[index];
}
return p;
}
}