As Value type variable allocates memory in Stack whereas Reference type allocates it in Heap.
So how the memory allocated when a value type variable (e.g. int i = 4;) is declared in the reference type (e.g. in a class).
How the overall memory allocation works in .NET for value type & reference type, and also value type inside the scope of reference type.
Please explain it or provide any links regarding that.
If the object lies on heap, it means all it’s member variable(s) lies there.