Wednesday, February 14, 2018

Stack, Heap, Value Type, And Reference Type In C#

Now, let’s see what happens when we declare any variable like int a=10 in C#. When C# compiler will run, it will allocate a block of memory which will have name of variable i.e. a, its type i.e. int and its value i.e. 10. Now this memory can be of type Stack or Heap i.e. variable gets store in Stack or Heap.

source http://www.c-sharpcorner.com/article/stack-heap-value-type-and-reference-type-in-c-sharp/

No comments:

Post a Comment