Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Both of them are stored on the stack. You only store on the heap when requesting memory from it, for example through calls to malloc() in C or new() in C++. In that case, you usually have a pointer sitting on the stack, which points to the allocated memory region on the heap.
4th Apr 2020, 6:10 PM
Shadow
Shadow - avatar