null address ^ null-pointer-variable

@ A null address is the fake address of 0. It doesn’t exist physically. Compiler treats it differently (Don’t ask me how…)
@ A null-pointer-variable is a pointer variable holding a null address.

I think this is a source of confusion to newbies. A so-called “Null pointer” means one of these 2.

There’s just one null address, /to the extent that/ there’s just one Address 0xFF8AE0 or whatever. But there can be 5 (or 5555) null pointer variables. Note each pointer variable doesn’t [1] always occupy 32 bits (assuming a 32-bit bus), but usually does. If it does, then the pointer variable’s own address is never 0. (Anything that’s /allocated/ an address is never at Address 0 since Address 0 doesn’t exist.)

[1] I guess if a pointer variable has a brief lifespan it may live in the cache or thread register??

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s