What stores in stack?
What stores in Heap?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jul 9, 2013, 8:46 AM EDT
Everything else is stored on the heap.
Where local variables or value parameters refer to reference types (such as string, object etc), only the reference is stored on the stack. The object itself (unless the reference is null) is stored on the heap.
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 9, 2013, 8:54 AM EDT
Please refer the below link.
http://gribblelab.org/CBootcamp/7_Memory_Stack_vs_Heap.html
Regards,
Iftikar
Sreekanth ReddyRank #726 · 3.2K reputationPosted Jul 9, 2013, 9:04 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jul 9, 2013, 9:06 AM EDT
However, static variables are always stored on the heap.
Sreekanth ReddyRank #726 · 3.2K reputationPosted Jul 9, 2013, 9:12 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jul 9, 2013, 9:20 AM EDT
In all other cases, it's stored on the heap.