Is a pointer pointing to address 0x2 really a null pointer
0x2 is not a null pointer constant.
The value of null however is unspecified. In theory, it could be 2. But on most systems it is 0. The output that you show demonstrates that null does not have the value 2 on your system.
(Which causes a Segmentation Fault)?
Indirecting through null is not the only thing that causes a segfault.
How can I handle cases like 0x2 by if statements? (I mean, handle cases in which dereferencing would cause a Segmentation Fault.
You "handle" them by never attempting to indirect through invalid pointers. There is no way to know whether a pointer is valid based on its value (except, we know that null is never valid).
What are addresses other than 0x2 which dereferencing a pointer pointing to them causes a Segmentation Fault and why?
From C++ perspective: Accessing any object outside of their lifetime causes the behaviour of the program to be undefined. If there is no object at address X, then accessing *X is undefined behaviour unless otherwise specified. Objects are created by defining variables, and using new
-expressions.
From OS perspective, these things cause a segfault: All addresses, which are not mapped to any memory. All writes to read only memory.