This might be a dupe. I did not find enough information on this.
I was discussing memory allocation for collections in .Net. Where is the memory for elements allocated in a collection?
List<int> myList = new List<int>();
The variable myList is allocated on stack and it references the List object created on heap.
The question is when int elements are added to the myList, where would they be created ?
Can anyone point the right direction?