Name

NULL macro — Null pointer

Synopsis

#define NULL  
                  . . .

The NULL macro expands to a null pointer constant, such as 0 or 0L.

image with no caption

Some C libraries declare NULL as ((void*)0) in stddef.h. This definition is fine for C, but is wrong for C++. Most C++ compilers correctly declare NULL, but you should be aware of the difference.

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.