C # Arrays are reference types, so how are they stored in memory?
Debug C # programs in VS, how to view memory, registers, disassembly in this article see how to view memory in VS
First breakpoint hit after the array creation statement there, point Debug->windows->memory, choose a random Memory
In the Immediate window, enter the & variable name arr to get the memory address of arr.
&arr
0X009BECD8-----> referencing addresses in the stack
*&ARR:0X02D75CB4-----> Start Address of space in the managed heap
After these days of fast food knowledge learning, know that the stack is filled with high-low padding. In the managed heap, it seems that the opposite is not certain, because garbage is recycled as part of the compression of objects that are referenced.
See Memory Ha ~ C8 3b B8 72 09 What I don ' t know, if you know, let me know.
INT 32, the normal value type is a struct.
There's also a trick, recently learned, vs inside automatically generate constructors, enter ctor, then point Ctrl+r+e
There is also a trick to automatically generate Get,set. private int _name, then click Tab
String and object are the only predefined two reference types.
16 Storage in memory 00 00 00 10
15 Storage in Memory 0F
Suddenly wanted to reflect arr[0]. The Range GetType () int32 represents is
An integer of plus or minus 2 of the 31-time Square. Is there a sign that indicates a bit? I guess.
http://blog.csdn.net/zxsydyq/article/details/9125641 C # int16 Int32 int64 difference long is not true long,.net Framework type is int64 Short is not real, the. NET Framework type is Int16
Storage of C # arrays in memory