The best C standard library - <stddef.h> Tutorial In 2024, In this tutorial you can learn Brief introduction,Library variants,Macro library,
stddef .h header file defines various types of variables and macros.Most of these definitions are also present in other header files.
Here is a variable type defined in the header file stddef.h:
序号 | 变量 & 描述 |
---|---|
1 | ptrdiff_t 这是有符号整数类型,它是两个指针相减的结果。 |
2 | size_t 这是无符号整数类型,它是sizeof关键字的结果。 |
3 | wchar_t 这是一个宽字符常量大小的整数类型。 |
The following is a macro defined in the header file stddef.h:
序号 | 宏 & 描述 |
---|---|
1 | NULL 这个宏是一个空指针常量的值。 |
2 | offsetof(type, member-designator) 这会生成一个类型为 size_t 的整型常量,它是一个结构成员相对于结构开头的字节偏移量。成员是由member-designator给定的,结构的名称是在type中给定的。 |