Munish Kumar

Munish Kumar

  • 1.3k
  • 451
  • 10k

Where does the data members of a class are stored?

Jan 7 2019 7:08 AM
I am bit confused about it that where does the data members of a class are stored, in stack or heap.
 
If i have below code:
  1. class Test  
  2.         {  
  3.             int A = 0;  
  4.         }  
then, where does "A" stores? 
 
I know value types stores in stack and reference types stores in heap, so class "Test" would store in Heap, but confused about "A".
 
Could anyone help me to understand this.

Answers (5)