Whats the difference between HEAP and STACK?
Heap: The heap is a large pool of memory that can be allocated at runtime by application programs. Memory is allocated from a global pool, or heap, that is defined in the .sysmem section. You can set the size of the .sysmem section by using the –heap_size=size option with the linker command. The linker also creates a global symbol __SYSMEM_SIZE, and assigns it a value equal to the size of the heap in bytes. The default size is 1K bytes. Dynamically allocated objects are not addressed directly, they are always accessed with the help of pointers, and the memory pool is in a separate section (.sysmem); therefore, the dynamic memory pool can have a size limited only by the amount of available memory in your system. To conserve space in the .bss section, you can allocate large arrays from the heap instead of defining them as global or static. Stack: The stack is where memory is allocated for automatic variables within functions. The stack memory is used to: • Allocate local variables • Pas