Null pointer abstraction

Jul 12, 2012 at 2:47pm
 
int *my_ptr = 0;


When you set up a null pointer, printing the address will usually show it's pointing to memory address 0 (or 0x0 or 00000000 or what have you).

I'm pretty sure this is an abstraction and you're not actually pointing to that address, it's just a way of representing a null pointer. Is it the C++ language that's responsible for this abstraction or is it compiler specific?
Jul 12, 2012 at 2:49pm
It's up to the compiler.
Jul 12, 2012 at 2:58pm
There's a page at C FAQ about non-zero null pointers: http://c-faq.com/null/machexamp.html
Jul 12, 2012 at 4:34pm
Excellent. Cheers guys.
Topic archived. No new replies allowed.