Richter "CLR via C#" famous book
I understand, when do unboxing, it returns pointer to unboxed value on heap, but i cant get pointer in C#, so there is copy of fields from heap to stack done (answered here).
But, when i do
Console.WriteLine(v + ", " + (Int32)o);
so, when i do unboxing of object "o", only pointer passed, without copy. "...This requires an unboxing operation (but no copy operation)..." (Richter, page 129)
Now, my question is: when return pointer to unboxed value on heap and when it also copied to the stack?
Thanks
P.S.: code:
Int32 v = 5;
Object o = v;
Console.WriteLine(v + ", " + (Int32)o);