This is basically an agreement, and it is implementation specific.
The C language standard (C99 or C11) and some other programming languages, such as Lisp, have the concept of a null pointer that cannot be dereferenced (this will be undefined behavior , segmentation error ) and differs from any other pointer (in some valid memory location) . Tony Hoar modestly called this concept โthe error of my billion dollarsโ , and some languages โโ(Haskell, Ocaml) have marked unions (for example, 'a option in Ocaml).
Most implementations (but not all) represent a null pointer at address 0.
In practice, on a desktop computer, laptop or tablet, the user-mode C program runs in the virtual address space , where a page containing address 0 is not displayed. (On some Linux you could have mmap (2) with a MAP_FIXED address of 0, but that would taste bad ...)
In some embedded microcontrollers (e.g. AVR ), address 0 can be used.
In theory (and in the past) addresses can be more complex than numbers ... (in the 1980s, for example, segmentation of x86 memory on i286 and iAPX432 , Rekursiv , etc.)
Read some books and web pages on C programming, microprocessor architectures and instruction sets,, virtual memory , MMU s.
source share