C# reference pointer : <pre><code>using System;

public class Class1 {
     public int A {get;set;}    
}

public class Class2 {
    public Class1 class1 {get;set;} 
}

public class Test
{
    public static void Main()
    {
        Class1 c1 = null;
        var c2 = new Class2();
        c2.class1 = c1;

        c1 = new Class1();
        c1.A = 1;

        Console.WriteLine(c2.class1.A); //Expect 1 not NULL ref err
    }
}
</code></pre>

<p>I would expect that the <code>c2</code> object would get its <code>class1</code> reference updated because its passing by reference, so the reference was updated but it remained null.</p>

<p>When you set c2.class1 = c1  and c1 is currently null does it keep the the value <code>null</code> and not use a pointer to the empty memory space?</p>
