Identifying if an address belongs to heap or stack or registers

Viewed 1931

I have a pointer available with me to a C/C++ variable. Is it possible to exactly make out which segment of the memory this variable belongs to ? If yes, how ?

Note: I just have the address of this variable, no further information if the variable is local/global etc.

4 Answers
Related