The VM page, which is located at the address (void *)0x0 or NULL , is not displayed by default on any modern OS, so dereferencing the NULL pointer will result in segmentation violation.
NULL pointers are often used as pointers that do not point anywhere.
Yes, you can get the address of your text, stack and heap. For the stack, this is relatively simple, for text and heap you need to consult /proc/self/smaps (if you have procfs ).
source share