在哪里存储引用类型中的值类型? [英] Where the value type inside a reference type will be stored ?
本文介绍了在哪里存储引用类型中的值类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
我对Stack和Heap有基本的了解,我知道所有的值类型都将存储在堆栈中的堆栈和引用类型中。但是如果我在类中有一个值类型,那么它将存储在哪里?这将如何在内存中工作?
-Manu
解决方案
尽管有条件,值类型仍存储在堆栈中。
这些文章应该可以帮助您理解价值类型 -
关于价值类型的真相 [ ^ ]
六个重要的.NET概念:堆栈,堆,值类型,引用类型,装箱和拆箱 [ ^ ]
Dear All,
I have a basic knowledge regarding Stack and Heap, and I know all value type will be stored in stack and reference type in heap. But if I have a value type inside a class then where it will be stored? How this will work inside the memory?
-Manu
解决方案
Value types are stored in the stack though there are conditions.
These articles should help you understand a little bit about value types -
The truth about value types[^]
Six important .NET concepts: Stack, heap, value types, reference types, boxing, and unboxing[^]
这篇关于在哪里存储引用类型中的值类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文