Possible Duplicate:
Stack & heap understanding question
I was told in Is using var actually slow? If so, why? that value types are stored on the stack and class types are stored in the heap.
class MyClass
{
private int myInt;
private int[] myInts;
}
Where is MyClass.myInt
stored? MyClass
is a class/reference type, so it's on the heap. myInt
is a value type, so is it stored on some kind of "inside stack"?
Also, what about the array? Is it a value or a class?