Question: are variables stored in main memory?
Answer: Where in memory are my variables stored in C? ... Variables declared and defined in main function -----> heap. Pointers (for example, char *arr , int *arr ) -------> heap. Dynamically allocated space (using malloc and calloc) --------> stack.