1
Reply

c# how is "create array class from class that has array variable"?

kara yel

kara yel

Apr 7 2009 4:43 PM
3k

hi i wrote a code i c# and i create stuct array from struct that has a array but i have a error on Visual Studio.

my code:

public class o {

public int[] a = new int[5];

public int[] b = new int[5];

public int[] c = new int[5];

}

public class b {

public o[] yy = new o[5];

}

public Form1()

{

InitializeComponent();

}

private void Form1_Load(object sender, EventArgs e)

{

b[] oo = new b[5];

oo[0].yy[0].a[1] = 4;

}

}

 

i have error:

Object reference not set to an instance of an object.

 

how i can solution this problem ?

best regard.

 


Answers (1)