memory allocation of value types and reference types in .net framework

后端 未结 5 1995
独厮守ぢ
独厮守ぢ 2020-11-29 10:05

Is there an advanced article which I can read that can explain how memory is allocated for different types (value and reference) in .net framework.

for example we kn

5条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 10:17

    Remember the rule, Reference types always goes to the Heap, whereas Value Types always go where they were declared. If a Value Type is declared outside of a method, but inside a Reference Type it will be placed within the Reference Type on the Heap.

提交回复
热议问题