considering that the memory is divided into four segments: stack heap, code and data,
I think they would be allocated as follows:
I think they would be allocated as follows:
- Global variables ------->
- Local variables -------> stack
- Static Global variables -------> stack
- Static Local variables -------> stack
- Constant data types ----->
- Pointer -------->
- Register -----> CPU register
- Pointers (for example, char *arr, int *arr) -------> heap
- Dynamically allocated space (using malloc and calloc) --------> stack