By considering that the memory is divided into four segments: data, heap, stack, and code, where do global variables, static variables, constant data types, local variables (defined and declared in functions), variables (in main function), pointers, and dynamically allocated space (using malloc,calloc) get stored in memory?
I think they would be allocated as follows:
You got some of these right, but whoever wrote the questions tricked you on at least one question:
int *arr) ------->
staticpointer, in which case the pointer itself would end up in the data segment.
It is worth mentioning that "stack" is officially called "automatic storage class".