I'm looking for help understanding the information given on this web page. https://www.google.com/amp/s/www.geeksforgeeks.org/memory-layout-of-c-program/amp/ I use gcc compiler on windows 10 system.
I only know that there are two types of memory in hardware, one is ROM and one is RAM. Program is stored in ROM memory and data is stored in RAM. In this scenario, i don't understand what is Heap and Stack memory. I think RAM memory is divided into two parts Stack and Heap memory. Compiler decides where to put variables on Heap or Stack based on storage classes. so can you tell me what is the advantage of storing variable on Stack and what is the advantage of storing variable on Heap.
I only know that there are two types of memory in hardware, one is ROM and one is RAM. Program is stored in ROM memory and data is stored in RAM. In this scenario, i don't understand what is Heap and Stack memory. I think RAM memory is divided into two parts Stack and Heap memory. Compiler decides where to put variables on Heap or Stack based on storage classes. so can you tell me what is the advantage of storing variable on Stack and what is the advantage of storing variable on Heap.