How does the heap and stack work for instances and members of struct in C#?
问题 I'm reading a book which says: The variable representing an struct instance doesn’t contain a pointer to an instance; the variable contains the fields of the instance itself. Because the variable contains the instance’s fields, a pointer doesn’t have to be dereferenced to manipulate the instance’s fields. The following code demonstrates how reference types and value types differ class SomeRef { public Int32 x; } struct SomeVal { public Int32 x; } static void ValueTypeDemo() { SomeRef r1 = new