class Program
{
class Chair
{
public Array[] people { get; set; }
}
static void Main(string[] args)
{
var chr = new Chair();
if(chr.people.Length > 0) Console.WriteLine("got eeem");
}
I have tried to do it like this also:
class Program
{
Chair chr { get; set; }
class Chair
{
public Array[] people { get; set; }
}
static void Main(string[] args)
{
var pr = new Program();
if(pr.chr.people.Length > 0) Console.WriteLine("got eeem");
}
I keep getting the same error:
Object reference not set to an instance of an object.
When checking if the length is greater than 0 (Eventually I'll be adding to it).
Why can't I check its greater than 0? I instance it in two ways and neither work?
Thanks in advance!