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

📄 stdio.html

📁 ST20 Embedded Toolset R2.0.5用于开发基于ST20芯片机顶盒软件的开发平台,2.0.5版本,国内找不到的.在国外论坛上花了N天才找到!
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<H2><A NAME="fpos_t"><CODE>fpos_t</CODE></A></H2><PRE>typedef <I>o-type</I> <B>fpos_t</B>;</PRE><P>The type is an object type <CODE><I>o-type</I></CODE>of an object that you declare to hold the value of afile-position indicator stored by<A HREF="#fsetpos"><CODE>fsetpos</CODE></A> and accessed by<A HREF="#fgetpos"><CODE>fgetpos</CODE></A>.</P><H2><A NAME="fprintf"><CODE>fprintf</CODE></A></H2><PRE>int <B>fprintf</B>(FILE *stream, 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 writeseach generated character to the stream <CODE>stream</CODE>. It returns thenumber of characters generated, or it returns a negative value ifthe function sets the error indicator for the stream.</P><H2><A NAME="fputc"><CODE>fputc</CODE></A></H2><PRE>int <B>fputc</B>(int c, FILE *stream);</PRE><P>The function writes the character <CODE>(unsigned char)c</CODE> tothe output stream <CODE>stream</CODE>, advances thefile-position indicator (if defined),and returns <CODE>(int)(unsigned char)c</CODE>. If the functionsets the error indicator for the stream, it returns<A HREF="#EOF"><CODE>EOF</CODE></A>.</P><H2><A NAME="fputs"><CODE>fputs</CODE></A></H2><PRE>int <B>fputs</B>(const char *s, FILE *stream);</PRE><P>The function accesses characters from the<A HREF="lib_over.html#C string">C string</A> <CODE>s</CODE> andwrites them to the output stream <CODE>stream</CODE>. The function doesnot write the terminating null character. It returns a nonnegativevalue if it has not set the error indicator; otherwise, it returns<A HREF="#EOF"><CODE>EOF</CODE></A>.</P><H2><A NAME="fread"><CODE>fread</CODE></A></H2><PRE>size_t <B>fread</B>(void *ptr,    size_t size, size_t nelem, FILE *stream);</PRE><P>The function reads characters from the input stream <CODE>stream</CODE>and stores them in successive elements of the array whose first elementhas the address <CODE>(char *)ptr</CODE>until the function stores <CODE>size*nelem</CODE>characters or sets the end-of-file or error indicator. It returns<CODE>n/size</CODE>, where <CODE>n</CODE>is the number of characters it read.If <CODE>n</CODE> is not a multiple of <CODE>size</CODE>,the value stored in the last element is indeterminate.If the function sets the error indicator, thefile-position indicator is indeterminate.</P><H2><A NAME="freopen"><CODE>freopen</CODE></A></H2><PRE>FILE *<B>freopen</B>(const char *filename, const char *mode,    FILE *stream);</PRE><P>The function closes the file associated withthe stream <CODE>stream</CODE> (as if by calling<A HREF="#fclose"><CODE>fclose</CODE></A>);then it opens the file with the filename <CODE>filename</CODE>and associates the file with the stream <CODE>stream</CODE>(as if by calling<CODE><A HREF="#fopen">fopen</A>(filename, mode)</CODE>).It returns <CODE>stream</CODE> if the open is successful;otherwise, it returns a null pointer.</P><H2><A NAME="fscanf"><CODE>fscanf</CODE></A></H2><PRE>int <B>fscanf</B>(FILE *stream, 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 <CODE>stream</CODE>. 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 errorindicator for the stream.</P><H2><A NAME="fseek"><CODE>fseek</CODE></A></H2><PRE>int <B>fseek</B>(FILE *stream, long offset, int mode);</PRE><P>The function sets thefile-position indicator for the stream<CODE>stream</CODE> (as specified by<CODE>offset</CODE> and <CODE>mode</CODE>), clearsthe end-of-file indicator for the stream, and returns zero if successful.</P><P>For a<A HREF="lib_file.html#binary stream">binary stream</A>,<CODE>offset</CODE> is a signed offset in bytes:</P><UL><LI>If <CODE>mode</CODE> has the value<A HREF="#SEEK_SET"><CODE>SEEK_SET</CODE></A>,<CODE>fseek</CODE> adds <CODE>offset</CODE>to the file-position indicator for the beginning of the file.<LI>If <CODE>mode</CODE> has the value<A HREF="#SEEK_CUR"><CODE>SEEK_CUR</CODE></A>,<CODE>fseek</CODE> adds <CODE>offset</CODE> to the currentfile-position indicator.<LI>If <CODE>mode</CODE> has the value<A HREF="#SEEK_END"><CODE>SEEK_END</CODE></A>,<CODE>fseek</CODE> adds <CODE>offset</CODE> to thefile-position indicator for the end of the file(possibly after arbitrary null character padding).</UL><P><CODE>fseek</CODE> sets the file-position indicator to the resultof this addition.</P><P>For a<A HREF="lib_file.html#text stream">text stream</A>:</P><UL><LI>If <CODE>mode</CODE> has the value<A HREF="#SEEK_SET"><CODE>SEEK_SET</CODE></A>,<CODE>fseek</CODE> sets thefile-position indicator to the value encodedin <CODE>offset</CODE>, which is either a value returnedby an earlier successful call to<A HREF="#ftell"><CODE>ftell</CODE></A>or zero to indicate the beginning of the file.<LI>If <CODE>mode</CODE> has the value<A HREF="#SEEK_CUR"><CODE>SEEK_CUR</CODE></A>and <CODE>offset</CODE> is zero, <CODE>fseek</CODE> leaves thefile-position indicator at its current value.<LI>If <CODE>mode</CODE> has the value<A HREF="#SEEK_END"><CODE>SEEK_END</CODE></A>and <CODE>offset</CODE> is zero, <CODE>fseek</CODE> sets thefile-position indicator to indicate the end of the file.</UL><P>The function defines no other combination of argument values.</P><H2><A NAME="fsetpos"><CODE>fsetpos</CODE></A></H2><PRE>int <B>fsetpos</B>(FILE *stream, const fpos_t *pos);</PRE><P>The function sets the file-position indicator for the stream<CODE>stream</CODE> to the value stored in <CODE>*pos</CODE>,clears the end-of-file indicator for the stream,and returns zero if successful. Otherwise,the function stores a positive value in<A HREF="errno.html#errno"><CODE>errno</CODE></A>and returns a nonzero value.</P><H2><A NAME="ftell"><CODE>ftell</CODE></A></H2><PRE>long <B>ftell</B>(FILE *stream);</PRE><P>The function returns an encoded form of the file-position indicatorfor the stream <CODE>stream</CODE> or stores a positive value in<A HREF="errno.html#errno"><CODE>errno</CODE></A> and returnsthe value -1. For a binary file, a successful returnvalue gives the number of bytes from the beginning of the file. Fora text file, target environments can vary on the representation andrange of encoded file-position indicator values.</P><H2><A NAME="fwrite"><CODE>fwrite</CODE></A></H2><PRE>size_t <B>fwrite</B>(const void *ptr,    size_t size, size_t nelem, FILE *stream);</PRE><P>The function writes characters to the output stream <CODE>stream</CODE>,accessing values from successive elements of the array whose firstelement has the address <CODE>(char *)ptr</CODE> until the function writes<CODE>size*nelem</CODE> characters or sets the error indicator. It returns<CODE>n/size</CODE>, where <CODE>n</CODE>is the number of characters it wrote.If the function sets the error indicator,the file-position indicator is indeterminate.</P><H2><A NAME="getc"><CODE>getc</CODE></A></H2><PRE>int <B>getc</B>(FILE *stream);</PRE><P>The function has the same effect as<CODE><A HREF="#fgetc">fgetc</A>(stream)</CODE> exceptthat a macro version of <CODE>getc</CODE>can evaluate <CODE>stream</CODE> more than once.</P><H2><A NAME="getchar"><CODE>getchar</CODE></A></H2><PRE>int <B>getchar</B>(void);</PRE><P>The function has the same effect as<CODE><A HREF="#fgetc">fgetc</A>(stdin)</CODE>,reading a character from the stream<A HREF="#stdin"><CODE>stdin</CODE></A></P><H2><A NAME="gets"><CODE>gets</CODE></A></H2><PRE>char *<B>gets</B>(char *s);</PRE><P>The function reads characters from the stream<A HREF="#stdin"><CODE>stdin</CODE></A>and stores them in successive elements of the array whose first elementhas the address <CODE>s</CODE> until the function readsan <CODE><I>NL</I></CODE> character(which is not stored) or sets the end-of-file or error indicator.If <CODE>gets</CODE> reads any characters, it concludes by storing a nullcharacter in the next element of the array. It returns <CODE>s</CODE> ifit reads any characters and has not set the error indicator for thestream; otherwise, it returns a null pointer. If it sets the errorindicator, the array contents are indeterminate. The number of charactersthat <CODE>gets</CODE> reads and stores cannot be limited. Use<A HREF="#fgets"><CODE>fgets</CODE></A> instead.</P><H2><A NAME="_IOFBF"><CODE>_IOFBF</CODE></A></H2><PRE>#define <B>_IOFBF</B> <I>&lt;integer constant expression&gt;</I></PRE><P>The macro yields the value of the <CODE>mode</CODE> argument to<A HREF="#setvbuf"><CODE>setvbuf</CODE></A> to indicate<B><A NAME="full buffering">full buffering</A></B>.(Flush the stream buffer only when it fills.)</P><H2><A NAME="_IOLBF"><CODE>_IOLBF</CODE></A></H2><PRE>#define <B>_IOLBF</B> <I>&lt;integer constant expression&gt;</I></PRE><P>The macro yields the value of the <CODE>mode</CODE> argument to<A HREF="#setvbuf"><CODE>setvbuf</CODE></A> to indicate<B><A NAME="line buffering">line buffering</A></B>.(Flush the stream buffer at the end of a<A HREF="lib_file.html#text lines">text line</A>.)</P><H2><A NAME="_IONBF"><CODE>_IONBF</CODE></A></H2><PRE>#define <B>_IONBF</B> <I>&lt;integer constant expression&gt;</I></PRE><P>The macro yields the value of the <CODE>mode</CODE> argument to<A HREF="#setvbuf"><CODE>setvbuf</CODE></A> to indicate<B><A NAME="no buffering">no buffering</A></B>.(Flush the stream buffer at the end of each write operation.)</P><H2><A NAME="L_tmpnam"><CODE>L_tmpnam</CODE></A></H2><PRE>#define <B>L_tmpnam</B> <I>&lt;integer constant expression &gt; 0&gt;</I></PRE><P>The macro yields the number of characters that the target environmentrequires for representing temporary filenames created by<A HREF="#tmpnam"><CODE>tmpnam</CODE></A>.</P><H2><A NAME="NULL"><CODE>NULL</CODE></A></H2><PRE>#define <B>NULL</B> <I>&lt;either 0, 0L, or (void *)0&gt;</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="perror"><CODE>perror</CODE></A></H2><PRE>void <B>perror</B>(const char *s);</PRE><P>The function writes a line of text to the stream<A HREF="#stderr"><CODE>stderr</CODE></A>.If <CODE>s</CODE> is not a null pointer,the function first writes the<A HREF="lib_over.html#C string">C string</A> <CODE>s</CODE>(as if by calling<CODE><A HREF="#fputs">fputs</A>(s, stderr)</CODE>),followed by a colon (<CODE>:</CODE>) and a <CODE><I>space</I></CODE>.It then writes the same message<A HREF="lib_over.html#C string">C string</A> that is returned by<CODE><A HREF="string.html#strerror">strerror</A>(errno)</CODE>,converting the value stored in<A HREF="errno.html#errno"><CODE>errno</CODE></A>,followed by an <CODE><I>NL</I></CODE>.</P><H2><A NAME="printf"><CODE>printf</CODE></A></H2><PRE>int <B>printf</B>(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 writeseach generated character to the stream<A HREF="#stdout"><CODE>stdout</CODE></A>.It returns the number of characters generated,or it returns a negative value if the functionsets the error indicator for the stream.</P><H2><A NAME="putc"><CODE>putc</CODE></A></H2><PRE>int <B>putc</B>(int c, FILE *stream);</PRE><P>The function has the same effect as<CODE><A HREF="#fputc">fputc</A>(c, stream)</CODE>except that a macro version of <CODE>putc</CODE>can evaluate <CODE>stream</CODE> more than once.</P><H2><A NAME="putchar"><CODE>putchar</CODE></A></H2><PRE>int <B>putchar</B>(int c);</PRE><P>The function has the same effect as<CODE><A HREF="#fputc">fputc</A>(c, stdout)</CODE>,writing a character to the stream<A HREF="#stdout"><CODE>stdout</CODE></A>.</P><H2><A NAME="puts"><CODE>puts</CODE></A></H2><PRE>int <B>puts</B>(const char *s);</PRE><P>The function accesses characters from the<A HREF="lib_over.html#C string">C string</A> <CODE>s</CODE> andwrites them to the stream<A HREF="#stdout"><CODE>stdout</CODE></A>. The function writesan <CODE><I>NL</I></CODE> character to the streamin place of the terminating null character.It returns a nonnegative value if it has not set theerror indicator; otherwise, it returns<A HREF="#EOF"><CODE>EOF</CODE></A>.</P><H2><A NAME="remove"><CODE>remove</CODE></A></H2><PRE>int <B>remove</B>(const char *filename);</PRE><P>The function removes the file with the filename <CODE>filename</CODE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -