Hi,
to create an array of 2 objects (e.g. of type '__gc class Airplane') I need
to do :
Airplane * arrAirplanes __gc[] = new Airplane* __gc[2];
arrAirplanes[0] = new Airplane("N12344");
arrAirplanes[1] = new Airplane("N12345");
Actually, I create an array of Airplane-pointers first and then create the
objects afterwards.
Now, what I would like is create the objects immediately, when creating the
array, something I can do in unmanaged C++ :
MyClass *p= new MyClass[2];
here are the objects created immediately.
Unfortunately, this does not work when the class is declared with __gc.
Or is it possible anyhow ?
In short, how do I create an array of managed objects directly, instead of
having to create an array of pointers first and then make the pointers point
to valid objects.
Thanks
Chris