Your reasoning is as follows:
- System.Int32 obtained from System.Object
- a derived type is always laid out in memory in the same way as its base type
- therefore System.Int32 is laid out in memory in the same way as System.Object
Yes?
. . , ? , ?
UPDATE: , , .
, :
struct S {
public int x;
public override string ToString() { return "Hello!" + x; }
}
...
S s = new S();
s.x = 0x00112233;
s.ToString();
? :
- s.x.
- 00 11 22 33 .
- S.ToString, , .
-, s.x ? : , S, , . -, System.Object, . ", "; , .