標準庫標頭檔案 <stddef.h>
來自 cppreference.com
此標頭檔案是型別支援庫的一部分,特別地,它提供了額外的基本型別和便利宏。
型別 | ||
減去兩個指標時返回的有符號整型 (型別定義) | ||
(C23) |
預定義空指標常量 nullptr 的型別 (型別定義) | |
(C11) |
與任何其他標量型別具有相同對齊要求的型別 (型別定義) | |
由 sizeof 運算子返回的無符號整型 (型別定義) | ||
常量 | ||
實現定義的空指標常量 (宏常量) | ||
宏 | ||
從結構體型別開頭到指定成員的位元組偏移量 (函式宏) |
[編輯] 概要
#define __STDC_VERSION_STDDEF_H__ 202311L typedef /* see description */ ptrdiff_t; typedef /* see description */ nullptr_t; typedef /* see description */ max_align_t; typedef /* see description */ wchar_t; typedef /* see description */ size_t; #define NULL /* see description */ #define unreachable() /* see description */ #define offsetof(P, D) /* see description */
僅當實現定義了 __STDC_LIB_EXT1__ 並且使用者程式碼在包含任何 <stddef.h>
之前定義了 __STDC_WANT_LIB_EXT1__ 時
#if defined(__STDC_WANT_LIB_EXT1__) typedef /* see description */ rsize_t; #endif