Hacker News new | ask | show | jobs
by jisnsm 460 days ago
> A NULL pointer dereference occurs when software attempts to access memory at address 0 (the NULL address) via a pointer set to NULL.

There is nothing in the standard that says that NULL must be 0.

1 comments

When's the last time you've seen a non zero NULL pointer?

We don't code for things like PDP-11 or Honeywell mainframes all that often.

https://c-faq.com/null/machexamp.html

Here is a non-zero null pointer: https://gcc.godbolt.org/z/Po5r5Pa36
whats going on here, I dont know enough C++ to understand