stddef.h
The stddef.h
header provides fundamental type aliases and macros. Many of these definitions also appear in other headers.
Excluding type aliases max_align_t
, ptrdiff_t
and wchar_t
and function-like macro offsetof
.
Type aliases
size_t
- Alias for:
- (x86)
unsigned int
- (x86-64)
unsigned long int
sizeof
operator returns asize_t
value. It is widely used in the standard library to represent sizes and counts. - (x86)
Macros
NULL
- Expands to
(void*)0
Macro for a null pointer. It has three primary use cases:- To initialise a pointer variable before assigning it a valid memory address.
- To return from a function when no valid memory address can be returned, e.g. for error handling.
- To pass as a function argument when it is not desired to pass a valid memory address.