📄 stddef.html
字号:
<HTML><HEAD><TITLE><stddef.h></TITLE></HEAD><BODY><H1><A NAME="<stddef.h>"><CODE><stddef.h></CODE></A></H1><HR><P>Include the standard header <B><CODE><stddef.h></CODE></B>to define several types and macros that areof general use throughout the program. Thestandard header <CODE><stddef.h></CODE> is available even in a<A HREF="lib_over.html#freestanding implementation">freestanding implementation</A>.</P><PRE> /* MACROS */#define <A HREF="#NULL"><B>NULL</B></A> <I><either 0, 0L, or (void *)0></I> <B>[0 in C++]</B>#define <A HREF="#offsetof"><B>offsetof</B></A>(<I>s-type</I>, mbr) <I><</I>size_t <I>constant expression></I> /* TYPES */typedef <I>si-type</I> <A HREF="#ptrdiff_t"><B>ptrdiff_t</B></A>;typedef <I>ui-type</I> <A HREF="#size_t"><B>size_t</B></A>;typedef <I>i-type</I> <A HREF="#wchar_t"><B>wchar_t</B></A>; <B>[keyword in C++]</B></PRE><H2><A NAME="NULL"><CODE>NULL</CODE></A></H2><PRE>#define <B>NULL</B> <I><either 0, 0L, or (void *)0></I> <B>[0 in C++]</B></PRE><P>The macro yields a null pointer constant that is usable as an<A HREF="express.html#address constant expression">address constant expression</A>.</P><H2><A NAME="offsetof"><CODE>offsetof</CODE></A></H2><PRE>#define <B>offsetof</B>(<I>s-type</I>, mbr) <I><</I>size_t <I>constant expression></I></PRE><P>The macro yields the offset in bytes, of type<A HREF="#size_t"><CODE>size_t</CODE></A>,of member <CODE>mbr</CODE> fromthe beginning of structure type <CODE><I>s-type</I></CODE>,where for <CODE>X</CODE> of type <CODE><I>s-type</I></CODE>,<CODE>&X.mbr</CODE> is an<A HREF="express.html#address constant expression">address constant expression</A>.</P><H2><A NAME="ptrdiff_t"><CODE>ptrdiff_t</CODE></A></H2><PRE>typedef <I>si-type</I> <B>ptrdiff_t</B>;</PRE><P>The type is the signed integer type <CODE><I>si-type</I></CODE>of an object that you declare to store the result ofsubtracting two pointers.</P><H2><A NAME="size_t"><CODE>size_t</CODE></A></H2><PRE>typedef <I>ui-type</I> <B>size_t</B>;</PRE><P>The type is the unsigned integer type <CODE><I>ui-type</I></CODE>of an object that you declare to store the result of the<A HREF="express.html#sizeof operator"><I>sizeof</I></A> operator.</P><H2><A NAME="wchar_t"><CODE>wchar_t</CODE></A></H2><PRE>typedef <I>i-type</I> <B>wchar_t</B>; <B>[keyword in C++]</B></PRE><P>The type is the integer type <CODE><I>i-type</I></CODE> of a<A HREF="charset.html#wide-character constant">wide-character constant</A>, such as <CODE>L'X'</CODE>.You declare an object of type <CODE>wchar_t</CODE> to hold a<A HREF="charset.html#Wide-Character Encoding">wide character</A>.</P><HR><P>See also the<B><A HREF="index.html#Table of Contents">Table of Contents</A></B> and the<B><A HREF="_index.html">Index</A></B>.</P><P><I><A HREF="crit_pb.html">Copyright</A> © 1989-2002by P.J. Plauger and Jim Brodie. All rights reserved.</I></P><!--V4.01:1125--></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -