[Previous] [Contents] [Next]

<stddef.h>


Include the standard header <stddef.h> to define several types and macros that are of general use throughout the program. The standard header <stddef.h> is available even in a freestanding implementation.

    /* MACROS */
#define NULL <either 0, 0L, or (void *)0> [0 in C++]
#define offsetof(s-type, mbr) <size_t constant expression>

    /* TYPES */
typedef si-type ptrdiff_t;
typedef ui-type size_t;
typedef i-type wchar_t; [keyword in C++]

NULL

#define NULL <either 0, 0L, or (void *)0> [0 in C++]

The macro yields a null pointer constant that is usable as an address constant expression.

offsetof

#define offsetof(s-type, mbr) <size_t constant expression>

The macro yields the offset in bytes, of type size_t, of member mbr from the beginning of structure type s-type, where for X of type s-type, &X.mbr is an address constant expression.

ptrdiff_t

typedef si-type ptrdiff_t;

The type is the signed integer type si-type of an object that you declare to store the result of subtracting two pointers.

size_t

typedef ui-type size_t;

The type is the unsigned integer type ui-type of an object that you declare to store the result of the sizeof operator.

wchar_t

typedef i-type wchar_t; [keyword in C++]

The type is the integer type i-type of a wide-character constant, such as L'X'. You declare an object of type wchar_t to hold a wide character.


See also the Table of Contents and the Index.

Copyright © 1989-2002 by P.J. Plauger and Jim Brodie. All rights reserved.

[Previous] [Contents] [Next]