I have a custom structure and I want to create an array of that type and initialize it while I'm at it. Here is an example.
struct Vect2d
{
int x;
int y;
}
Vect2d[] myvect = new Vect2d[] {new Vect2d(1,2), new Vect2d(2,2)}
The error obviously comes at Vect2d(1,2), saying I am trying to use a type(i.e. Vect2d) as a variable. I understand why it's wrong I just can't think of what it should be.
This post has been edited by nmgod: 26 January 2010 - 06:54 AM

New Topic/Question
Reply



MultiQuote






|