⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stdio.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 3 页
字号:
and returns zero if successful.If the file is open when you remove it,the result is implementation defined. After you remove it, youcannot open it as an existing file.</P><H2><A NAME="rename"><CODE>rename</CODE></A></H2><PRE>int <B>rename</B>(const char *old, const char *new);</PRE><P>The function renames the file with the filename <CODE>old</CODE> tohave the filename <CODE>new</CODE> and returns zero if successful. If afile with the filename <CODE>new</CODE> already exists,the result is implementation defined.After you rename it, you cannot open the filewith the filename <CODE>old</CODE>.</P><H2><A NAME="rewind"><CODE>rewind</CODE></A></H2><PRE>void <B>rewind</B>(FILE *stream);</PRE><P>The function calls<CODE><A HREF="#fseek">fseek</A>(stream, 0L, SEEK_SET)</CODE>and then clears the error indicator for the stream <CODE>stream</CODE>.</P><H2><A NAME="scanf"><CODE>scanf</CODE></A></H2><PRE>int <B>scanf</B>(const char *format, ...);</PRE><P>The function<A HREF="lib_scan.html#Scan Functions">scans formatted text</A>,under the control of the format <CODE>format</CODE>and any additional arguments. It obtains eachscanned character from the stream<A HREF="#stdin"><CODE>stdin</CODE></A>. It returns the numberof input items matched and assigned, or it returns<A HREF="#EOF"><CODE>EOF</CODE></A> if thefunction does not store values before it sets the end-of-file or errorindicators for the stream.</P><H2><A NAME="SEEK_CUR"><CODE>SEEK_CUR</CODE></A></H2><PRE>#define <B>SEEK_CUR</B> <I>&lt;integer constant expression&gt;</I></PRE><P>The macro yields the value of the <CODE>mode</CODE> argument to<A HREF="#fseek"><CODE>fseek</CODE></A>to indicate seeking relative to the currentfile-position indicator.</P><H2><A NAME="SEEK_END"><CODE>SEEK_END</CODE></A></H2><PRE>#define <B>SEEK_END</B> <I>&lt;integer constant expression&gt;</I></PRE><P>The macro yields the value of the <CODE>mode</CODE> argument to<A HREF="#fseek"><CODE>fseek</CODE></A>to indicate seeking relative to the end of the file.</P><H2><A NAME="SEEK_SET"><CODE>SEEK_SET</CODE></A></H2><PRE>#define <B>SEEK_SET</B> <I>&lt;integer constant expression&gt;</I></PRE><P>The macro yields the value of the <CODE>mode</CODE> argument to<A HREF="#fseek"><CODE>fseek</CODE></A>to indicate seeking relative to the beginning of the file.</P><H2><A NAME="setbuf"><CODE>setbuf</CODE></A></H2><PRE>void <B>setbuf</B>(FILE *stream, char *buf);</PRE><P>If <CODE>buf</CODE> is not a null pointer, the function calls<CODE><A HREF="#setvbuf">setvbuf</A>(stream, buf,__IOFBF, BUFSIZ)</CODE>,specifying full buffering with<A HREF="#_IOFBF"><CODE>_IOFBF</CODE></A>and a buffer size of<A HREF="#BUFSIZ"><CODE>BUFSIZ</CODE></A> characters.Otherwise, the function calls<CODE><A HREF="#setvbuf">setvbuf</A>(stream,0, _IONBF, BUFSIZ)</CODE>,specifying no buffering with<A HREF="#_IONBF"><CODE>_IONBF</CODE></A>.</P><H2><A NAME="setvbuf"><CODE>setvbuf</CODE></A></H2><PRE>int <B>setvbuf</B>(FILE *stream, char *buf, int mode,    size_t size);</PRE><P>The function sets the buffering mode for the stream <CODE>stream</CODE>according to <CODE>buf</CODE>, <CODE>mode</CODE>, and <CODE>size</CODE>.It returns zero if successful.If <CODE>buf</CODE> is not a null pointer, then <CODE>buf</CODE>is the address of the first element of an array of <I>char</I> ofsize <CODE>size</CODE> that can be used as the stream buffer. Otherwise,<CODE>setvbuf</CODE> can allocate a stream buffer that is freed when thefile is closed. For <CODE>mode</CODE> you must supply one of the followingvalues:</P><UL><LI><B><A HREF="#_IOFBF"><CODE>_IOFBF</CODE></A></B>-- to indicate full buffering<LI><B><A HREF="#_IOLBF"><CODE>_IOLBF</CODE></A></B>-- to indicate line buffering<LI><B><A HREF="#_IONBF"><CODE>_IONBF</CODE></A></B>-- to indicate no buffering</UL><P>You must call <CODE>setvbuf</CODE> after you call<A HREF="#fopen"><CODE>fopen</CODE></A>to associate a file with that stream and before you call a libraryfunction that performs any other operation on the stream.</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="sprintf"><CODE>sprintf</CODE></A></H2><PRE>int <B>sprintf</B>(char *s, const char *format, ...);</PRE><P>The function<A HREF="lib_prin.html#Print Functions">generates formatted text</A>,under the control of the format <CODE>format</CODE>and any additional arguments, and storeseach generated character in successive locations of the array object whosefirst element has the address <CODE>s</CODE>. The function concludes bystoring a null character in the next location of the array. It returnsthe number of characters generated -- not including the null character.<H2><A NAME="sscanf"><CODE>sscanf</CODE></A></H2><PRE>int <B>sscanf</B>(const char *s, const char *format, ...);</PRE><P>The function<A HREF="lib_scan.html#Scan Functions">scans formatted text</A>,under the control of the format <CODE>format</CODE>and any additional arguments. It accesses each scannedcharacter from successive locations of the array object whose firstelement has the address <CODE>s</CODE>.It returns the number of items matchedand assigned, or it returns<A HREF="#EOF"><CODE>EOF</CODE></A>if the function does not storevalues before it accesses a null character from the array.</P><H2><A NAME="stderr"><CODE>stderr</CODE></A></H2><PRE>#define <B>stderr</B> <I>&lt;pointer to FILE rvalue&gt;</I></PRE><P>The macro yields a pointer to the object that controls the standarderror output stream.</P><H2><A NAME="stdin"><CODE>stdin</CODE></A></H2><PRE>#define <B>stdin</B> <I>&lt;pointer to FILE rvalue&gt;</I></PRE><P>The macro yields a pointer to the object that controls the standardinput stream.</P><H2><A NAME="stdout"><CODE>stdout</CODE></A></H2><PRE>#define <B>stdout</B> <I>&lt;pointer to FILE rvalue&gt;</I></PRE><P>The macro yields a pointer to the object that controls the standardoutput stream.</P><H2><A NAME="tmpfile"><CODE>tmpfile</CODE></A></H2><PRE>FILE *<B>tmpfile</B>(void)</PRE><P>The function creates a temporary binary file with the filename<CODE><I>temp-name</I></CODE> and then has the same effect as calling<CODE><A HREF="#fopen">fopen</A>(<I>temp-name</I>,"wb+")</CODE>.The file <CODE><I>temp-name</I></CODE> is removed when the program closesit, either by calling<A HREF="#fclose"><CODE>fclose</CODE></A>explicitly or at normal program termination.The filename <CODE><I>temp-name</I></CODE> does not conflict withany filenames that you create. If the open is successful, the functionreturns a pointer to the object controlling the stream; otherwise,it returns a null pointer.</P><H2><A NAME="TMP_MAX"><CODE>TMP_MAX</CODE></A></H2><PRE>#define <B>TMP_MAX</B> <I>&lt;integer constant expression &gt;= 25&gt;</I></PRE><P>The macro yields the minimum number of distinct filenames createdby the function<A HREF="#tmpnam"><CODE>tmpnam</CODE></A>.</P><H2><A NAME="tmpnam"><CODE>tmpnam</CODE></A></H2><PRE>char *<B>tmpnam</B>(char *s);</PRE><P>The function creates a unique filename <CODE><I>temp-name</I></CODE> andreturns a pointer to the filename. If <CODE>s</CODE> is not a null pointer,then <CODE>s</CODE> must be the addressof the first element of an array at least of size<A HREF="#L_tmpnam"><CODE>L_tmpnam</CODE></A>.The function stores <CODE><I>temp-name</I></CODE>in the array and returns <CODE>s</CODE>.Otherwise, if <CODE>s</CODE> is a nullpointer, the function stores <CODE><I>temp-name</I></CODE>in a static-duration array and returns the address of its first element.Subsequent calls to <CODE>tmpnam</CODE>can alter the values stored in this array.</P><P>The function returns unique filenames for each of the first<A HREF="#TMP_MAX"><CODE>TMP_MAX</CODE></A>times it is called, after which its behavior is implementation defined.The filename <CODE><I>temp-name</I></CODE>does not conflict with any filenames that you create.</P><H2><A NAME="ungetc"><CODE>ungetc</CODE></A></H2><PRE>int <B>ungetc</B>(int c, FILE *stream);</PRE><P>If <CODE>c</CODE> is not equal to<A HREF="#EOF"><CODE>EOF</CODE></A>, the function stores<CODE>(unsigned char)c</CODE> in the objectwhose address is <CODE>stream</CODE>and clears the end-of-file indicator. If <CODE>c</CODE> equals<A HREF="#EOF"><CODE>EOF</CODE></A>or the store cannot occur, the function returns<A HREF="#EOF"><CODE>EOF</CODE></A>; otherwise,it returns <CODE>(unsigned char)c</CODE>. A subsequent library functioncall that reads a character from the stream <CODE>stream</CODE> obtainsthis stored value, which is then forgotten.</P><P>Thus, you can effectively<B><A NAME="push back">push back</A></B> a character to astream after reading a character. (You need not push back the samecharacter that you read.) An implementation can let you push backadditional characters before you read the first one. You read thecharacters in reverse order of pushing them back to the stream. Youcannot portably:</P><UL><LI>push back more than one character<LI>push back a character if the file-position indicator is at thebeginning of the file<LI>Call<A HREF="#ftell"><CODE>ftell</CODE></A>for a text file that has a character currently pushed back</UL><P>A call to the functions<A HREF="#fseek"><CODE>fseek</CODE></A>,<A HREF="#fsetpos"><CODE>fsetpos</CODE></A>, or<A HREF="#rewind"><CODE>rewind</CODE></A>for the stream causes the stream to forget any pushed-back characters.For a binary stream, the file-position indicator is decremented foreach character that is pushed back.</P><H2><A NAME="vfprintf"><CODE>vfprintf</CODE></A></H2><PRE>int <B>vfprintf</B>(FILE *stream, const char *format,     va_list ap);</PRE><P>The function<A HREF="lib_prin.html#Print Functions">generates formatted text</A>,under the control of the format <CODE>format</CODE>and any additional arguments, and writeseach generated character to the stream <CODE>stream</CODE>.It returns the numberof characters generated, or it returns a negative value if the functionsets the error indicator for the stream.</P><P>The function accesses additional arguments by using the contextinformation designated by <CODE>ap</CODE>.The program must execute the macro<A HREF="stdarg.html#va_start"><CODE>va_start</CODE></A>before it calls the function, and then execute the macro<A HREF="stdarg.html#va_end"><CODE>va_end</CODE></A>after the function returns.</P><H2><A NAME="vprintf"><CODE>vprintf</CODE></A></H2><PRE>int <B>vprintf</B>(const char *format,    va_list ap);</PRE><P>The function<A HREF="lib_prin.html#Print Functions">generates formatted text</A>,under the control of the format <CODE>format</CODE>and any additional arguments, and writeseach generated character to the stream<A HREF="#stdout"><CODE>stdout</CODE></A>.It returns the number of characters generated,or a negative value if the function setsthe error indicator for the stream.</P><P>The function accesses additional arguments by using the contextinformation designated by <CODE>ap</CODE>.The program must execute the macro<A HREF="stdarg.html#va_start"><CODE>va_start</CODE></A>before it calls the function, and then execute the macro<A HREF="stdarg.html#va_end"><CODE>va_end</CODE></A>after the function returns.</P><H2><A NAME="vsprintf"><CODE>vsprintf</CODE></A></H2><PRE>int <B>vsprintf</B>(char *s, const char *format,    va_list ap);</PRE><P>The function<A HREF="lib_prin.html#Print Functions">generates formatted text</A>,under the control of the format <CODE>format</CODE>and any additional arguments, and storeseach generated character in successive locations of the array object whosefirst element has the address <CODE>s</CODE>. The function concludes bystoring a null character in the next location of the array. It returnsthe number of characters generated -- not including the null character.</P><P>The function accesses additional arguments by using the contextinformation designated by <CODE>ap</CODE>.The program must execute the macro<A HREF="stdarg.html#va_start"><CODE>va_start</CODE></A>before it calls the function, and then execute the macro<A HREF="stdarg.html#va_end"><CODE>va_end</CODE></A>after the function returns.</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> &#169; 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 + -