© { JSL }
40
Text Box: Problem?
Problem?
Folded Corner:
·a reference can bind to a value
wdoes the reference refer into the stack?
wif so what happes when the scope ends?
struct Pair
{   
    public int X, Y;
    ...
}
class Example
{
    static object Dangle()
    {
        Pair p = new Pair(1,2);
        object o = p;
        return o;
    }
    static void Main()
    {
        object o = Dangle();
        ...
    }
}
p.X
stack
1
2
@
o
p.Y
?