On this page
  1. NULL
  2. Include
  3. Signature & Overview
  4. Notes & Pitfalls
  5. Example

NULL

Prev: ptrdiff_t | Up: stddef.h | Next: offsetof
Rel: stddef.h, stdint, stdbool & limits Guide
Ref: cppreference — NULL
Tags: #public #prog #c #stdlib #stddef #tier/core


Include

#include <stddef.h>

Signature & Overview

#define NULL /* null pointer constant */

Null pointer constant for C11/C17 (C23 adds type-safe nullptr).

Notes & Pitfalls

Example

#include <assert.h>
#include <stddef.h>

int main(void) {
    int *p = NULL;
    assert(p == NULL);
}

Linked from

Related notes