The answer is simple. I bet the bells start ringing when I say this. Usually with 32 bit systems, memory address is 32 bit wide. With 64 bit systems it often is 64 bits wide...
...Now, look at the pitfall III again, and you'll see that we do pinter arithmetics by handling pointers as integers. This means that half of the address will be cropped, and remaining address is most propably something pointing at invalid locations. After you use it, MMU will detect your process accessing out of the virtual address space mapped for the process. It'll kick up kernel, which most propably decides to send SIGSEGV signal to your program. And if youre writing anything more critical than snake game, you haven't registered handler which forgives SIGSEGV. Eg. result is segmentation fault. Adios. Bye. Game over. Sommoro ja Soronoo.
|All examples||No related posts|
|Explode function in C||ANSI C explode|
|Atomic Operations||(Finnish!) Atomiset Operaatiot (säikeet II)|
|Packed Array||C - optimize memory usage|
|Bitset in C||C - optimize memory usage|
|Trim/Rtrim (examples extended beyond post)||Trim/Rtrim|
|Linked list||No blog posts|
|Lottery machine||You can do OOP in C|