L
lavu
I have a class that has an array of string intialized to an empty
string. I am using an object
of this class in another file of the same project, and when I try to
access the string it gives
me an error "Object reference not set to instance of an object". While
debugging the value
of this string array element is <undefined value>.
eg.
public class A
{
string[] X = new string[1] {""); // will have more elements later
}
public class B
{
private A A1 = new A();
A1.X = "one" ; //error
}
string. I am using an object
of this class in another file of the same project, and when I try to
access the string it gives
me an error "Object reference not set to instance of an object". While
debugging the value
of this string array element is <undefined value>.
eg.
public class A
{
string[] X = new string[1] {""); // will have more elements later
}
public class B
{
private A A1 = new A();
A1.X = "one" ; //error
}