I am using VC++ 2005 Express Edition & I am having difficulty with creating an array of Point. I have tried
Point *a = new Point[50];
Point *a[] = new Point[50];
Point ^a = gcnew Point[50];
array
<Point ^> ^a = gcnew array<Point ^>(50);Point a[50];
& variants of these. Some of them compile & some do not. However, none of them work by allowing me to access their X & Y values (the program sometimes compiles but then crashes when run). The simple:
Point a = new Point; works properly.
I try to access the member variables with
a
->X or a
->X::set (or get) or a
.X
& if the program compiles this is where it crashes.
Can anyone help me I cannot use DrawPolygon (& other drawing functions) without a Point array.

VC++ 2005 Express Edition & an array of type Point
hobscrk777
Blade68
array<Point>^ a = gcnew array<Point>(50);
a[0].X = 1;
array<Point^>^ declares an array of pointers to Point. Your program crashes because the pointers are still null.