A pointer variable is an object that can point to another object. Here int *ptr = NULL; declares ptr as a pointer object, that potentially points to an object of int.

The value initially stored into this pointer object is NULL (it is initialized to NULL, so ptr does not point to any object).

Now, ptr too resides in memory. It needs enough bytes to contain the address of the pointed-to object. So it too needs to have an address. Therefore

  • ptr evaluates to the address of object that ptr points to.
  • &ptr evaluates to the location of the ptr object itself in memory
  • *ptr evaluates to the value of the object that ptr points to, if it points to an object. If it does not point to an object, then the behaviour is undefined.

Also, %p needs a void * as the corresponding argument, therefore the proper way to print them is

printf("%p\n", (void *)ptr);
printf("%p\n", (void *)&ptr);
Answer from Antti Haapala on Stack Overflow
🌐
freeCodeCamp
freecodecamp.org › news › a-quick-and-thorough-guide-to-null-what-it-is-and-how-you-should-use-it-d170cea62840
A quick and thorough guide to ‘null’: what it is, and how you should use it
June 12, 2018 - We intuitively associate a precise meaning to null. In a simple and flawless world, null would simply mean that Alice actually doesn't have an email address.
🌐
Quora
quora.com › In-computer-programming-what-is-the-address-of-null-in-memory
In computer programming, what is the address of null in memory? - Quora
Answer (1 of 4): If you’re talking about the value null (or NUL, or 0), a byte in which all bits are 0, any memory address could potentially point to a byte with this value. So, the address of a NUL byte could potentially be any memory address.
Discussions

c - Address of NULL pointer - Stack Overflow
So your pointer address is 0x7ff..., and its value is null, iow zero. ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... Is the “freezing” of infalling matter at a black hole horizon purely observational, or does it have physical meaning? More on stackoverflow.com
🌐 stackoverflow.com
c - What is the value of a NULL address location? - Stack Overflow
So incrementing a pointer by one unit means incrementing it's value by sizeof(int). Also, you aren't printing the value of which pointer is directing (as this would certainly crash your program) but the value of the pointer itself. You should definitely take a look at any pointers tutorial in C (or in general). ... thanks a lot , does it really point to the first address location when we point to NULL ... More on stackoverflow.com
🌐 stackoverflow.com
June 10, 2012
What is Null?
This was intended as a meme but is actually a good representation of what "Null" is. In C#, when you declare string s = "My shit"; it means that "s" is a reference to a memory location that holds the data "My shit". string s = null; means that the reference "s" exists but it's not pointing to any object, as in it holds nothing. More on reddit.com
🌐 r/learnprogramming
60
34
July 5, 2024
What does the word "null" appear in front… - Apple Community
Alert symbol What does a yellow ... point in the middle mean? This shows up almost immediately when I try to access my new mail & defaults to error page. HELP!!! 361 1 ... This message it usually means that your reply-to address may be labeled wrong. One place to start is Mail>Window>Previous Recipients ... This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers. What does the word "null" appear in ... More on discussions.apple.com
🌐 discussions.apple.com
May 9, 2018
🌐
Education Ecosystem
educationecosystem.com › home › what is the null address in crypto?
What is the Null Address in Crypto? Null Address in Crypto
January 3, 2022 - Standard addresses are just a string ... On the other hand, a null address is an address created specifically to receive tokens that are being intentionally removed out of circulation....
🌐
BitKan
bitkan.com › learn › what-is-null-address-in-crypto-is-null-address-the-same-as-vanity-address-9530
What is NULL address in crypto? Is null address the same as vanity address?
Null addresses in encryption are generated specifically to allow proof-of-burn. Token burns occur when tokens are intentionally sent to unusable wallets to remove them from circulation. This address is called the burn address or diner address.
🌐
Wordtothewise
wordtothewise.com › 2019 › 09 › null-sender-address
Null sender address | Word to the Wise
September 12, 2019 - If the 5321.from is the SPF domain and there is an entire class of email that doesn’t have a 5321.from, what do we do about SPF? Never fear, the SPF spec addresses that. When the message has a null from address, the domain in the HELO is checked for a SPF record.
🌐
Chainargos
docs.chainargos.com › documentation › concept-glossary › address-types › null-address
Null Address | Concept Glossary | ChainArgos
May 13, 2024 - Consequently the convention used for most blockchains is to use a string consisting entirely of 0s – know as the “null address” – to indicate “unknown private keys.” That string was clearly not randomly generated.
🌐
Quora
quora.com › Are-there-special-addresses-like-null-where-nothing-is-stored
Are there special addresses (like null) where nothing is stored? - Quora
Answer (1 of 3): Any address that is treated as NULL (or nullptr) by the compiler is special. Usually NULL points to address 0, but some systems have NULL point to other addresses.
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Glossary › Null
Null - Glossary - MDN Web Docs
In computer science, a null value represents a reference that points, generally intentionally, to a nonexistent or invalid object or address. The meaning of a null reference varies among language implementations.
🌐
TutorialsPoint
tutorialspoint.com › why-is-address-zero-used-for-the-null-pointer-in-c-cplusplus
NULL Pointer in C
A NULL pointer in C is a pointer that doesn't point to any of the memory locations. The NULL constant is defined in the header files stdio.h, stddef.h as well as stdlib.h. A pointer is initialized to NULL to avoid the unpredicted behavior of a
🌐
PixelPlex
pixelplex.io › home › glossary › zero address
Zero address Definition
May 23, 2025 - The zero address, also known as the null address, refers to a special blockchain address that consists entirely of zeros (e.g., 0x0000000000000000000000000000000000000000 in Ethereum-like systems).
🌐
VIPRE Helpdesk
helpdesk.vipre.com › hc › en-us › articles › 36698500494609-Null-Senders
Null Senders – VIPRE Helpdesk
June 30, 2025 - The Envelope-From is used by mail servers to determine where bounce messages should be sent if the email cannot be delivered. A null sender, as the name suggests, has an empty or null Envelope-From address.You can find more information on the ...
🌐
Medium
medium.com › @shlomohassid › null-how-do-you-define-nothing-and-why-would-you-07683bdbe63a
NULL: How Do You Define Nothing? And Why Would You? | by Momi | Medium
May 31, 2025 - If you had an array of 1000 null ... values. NULL doesn’t mean “nothing stored here” – it means “stored here is a token that signifies no target.”...
🌐
Scaler
scaler.com › home › topics › what is null pointer in c?
What is Null Pointer in C? - Scaler Topics
September 4, 2023 - A null pointer is a special reserved value declared in a header file called stddef. Null indicates that the pointer is pointing to the first memory location. meaning that 0th location.
Top answer
1 of 3
5

Dereferencing NULL is undefined behavior. Anything could happen, and most of the time bad things happen. So be scared.

Some old architectures (VAX ...) permitted you to derefence NULL.

The C11 standard specification (read n1570) does not require the NULL pointer to be all zero bits ( see C FAQ Q5.17); it could be something else, but it should be an address which is never valid so is not obtainable by a successful malloc or by the address-of operator (unary &), in the sense of C11. But it is more convenient to have it so, and in practice most (but not all) C implementations do so.

IIRC, on Linux, you might mmap(2) the page containing (void*)0 with MAP_FIXED, but it is not wise to do so (e.g. because a conforming optimizing compiler is allowed to optimize dereference of NULL).

So (void*)0 is not a valid address in practice (on common processors with some MMU and virtual memory running a good enough operating system!), because it is convenient to decide that it is NULL, and it is convenient to be sure that derefencing it gives a segmentation fault. But that is not required by the C standard (and would be false on cheap microcontrollers today).

A C implementation has to provide some way to represent the NULL pointer (and guarantee that it is never the address of some valid location). That might even be done by a convention: e.g. provide a full 232 bytes address space, but promise to never use address 0 (or whatever address you assigned for NULL, perhaps 42!)

When NULL happens to be derefencable, subtile bugs are not caught by a segmentation fault (so C programs are harder to debug).

Couldn't I invent a new architecture where the memory address 0 is accessible to processes?

You could, but you don't want to do that (if you care about providing any standard conforming C implementation). You prefer to make address 0 be the NULL. Doing otherwise make harder to write C compilers (and standard C libraries). And make that address invalid to the point of giving a segmentation fault when derefencing make debugging (and the life of your users coding in C) easier.

If you dream of weird architectures, read about Lisp machines (and Rekursiv, and iapx 432) and see The circuit less traveled talk at FOSDEM2018 by Liam Proven. It really is instructive, and it is a nice talk.

2 of 3
2

Making address zero unmapped so that a trap occurs if your program tries to access it is a convenience provided by many operating systems. It is not required by the C standard.

According to the C standard:

  • NULL is not be the address of any object or function. (Specifically, it requires that NULL compare unequal to a pointer to of any object or function.)
  • If you do apply * to NULL, the resulting behavior is not defined by the standard.

What this means for you is that you can use NULL as an indicator that a pointer is not pointing to any object or function. That is the only purpose the C standard provides for NULL—to use is tests such as if (p != NULL)…. The C standard does not guarantee that if you use *p when p is NULL that a trap will occur.

In other words, the C standard does not require NULL to provide any trapping capability. It is just a value that is different from any actual pointer, provided just so you have one pointer value that means “not pointing to anything.”

General-purpose operating systems typically arrange for the memory at address zero to be unmapped (and their C implementations define NULL to be (void *) 0 or something similar) specifically so that a trap will occur if you dereference a null pointer. When they do this, they are extended the C language beyond what the specification requires. They deliberately exclude address zero from the memory map of your process to make these traps work.

However, the C standard does not require this. A C implementation is free to leave the memory at address zero mapped, and, when you apply * to a null pointer, there might be data there, and your program could read and/or write that data, if the operating system has allowed it. When this is done, it is most often in code intended to run inside the operating system kernel (such as device drivers, kernel extensions, or the kernel itself) or embedded systems or other special-purpose systems with simple operating systems.

🌐
Etherscan
etherscan.io › address › 0x0000000000000000000000000000000000000000
Null: 0x000...000 | Address: 0x00000000...000000000 | Etherscan
This address is not owned by any user, is often associated with token burn & mint/genesis events and used as a generic null address