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:
- class Test
- {
- int A = 0;
- }
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.


Sreekanth ReddyRank #726 · 3.2K reputationPosted Jan 8, 2019, 1:55 AM EST
Sreekanth ReddyRank #726 · 3.2K reputationPosted Jan 8, 2019, 9:16 PM EST
Bryian TanRank #396 · 6.3K reputationPosted Jan 7, 2019, 11:23 AM EST
Puneet KankarRank #446 · 5.6K reputationPosted Jan 7, 2019, 5:30 PM EST
Munish KumarRank #3,278 · 438 reputationPosted Jan 8, 2019, 8:19 PM EST