<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Standard C I/O [C++ Reference]
</title>
<meta name="generator" content="DokuWiki Release 2009-12-25c &quot;Lemming&quot;" />
<meta name="robots" content="index,follow" />
<meta name="date" content="2009-02-17T07:33:30-0800" />
<meta name="keywords" content="c,io,start" />
<link rel="search" type="application/opensearchdescription+xml" href="/wiki/lib/exe/opensearch.php" title="C++ Reference" />
<link rel="start" href="/wiki/" />
<link rel="contents" href="/wiki/c/io/start?do=index" title="Index" />
<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="/wiki/feed.php" />
<link rel="alternate" type="application/rss+xml" title="Current Namespace" href="/wiki/feed.php?mode=list&amp;ns=c:io" />
<link rel="edit" title="Edit this page" href="/wiki/c/io/start?do=edit" />
<link rel="alternate" type="text/html" title="Plain HTML" href="/wiki/_export/xhtml/c/io/start" />
<link rel="alternate" type="text/plain" title="Wiki Markup" href="/wiki/_export/raw/c/io/start" />
<link rel="canonical" href="http://www.cppreference.com/wiki/c/io/start" />
<link rel="stylesheet" media="all" type="text/css" href="/wiki/lib/exe/css.php?s=all&amp;t=custom1&amp;tseed=1272971091" />
<link rel="stylesheet" media="screen" type="text/css" href="/wiki/lib/exe/css.php?t=custom1&amp;tseed=1272971091" />
<link rel="stylesheet" media="print" type="text/css" href="/wiki/lib/exe/css.php?s=print&amp;t=custom1&amp;tseed=1272971091" />
<script type="text/javascript" charset="utf-8" ><!--//--><![CDATA[//><!--
var NS='c:io';var JSINFO = {"id":"c:io:start","namespace":"c:io"};
//--><!]]></script>
<script type="text/javascript" charset="utf-8" src="/wiki/lib/exe/js.php?tseed=1272971091" ></script>
<link rel="shortcut icon" href="/wiki/lib/tpl/custom1/images/favicon.png" />
</head>
<body>
<div class="dokuwiki">
<div class="stylehead">
<div class="header">
<div class="pagename">
[[<a href="../../c/io/start.html" title="Backlinks">Standard C I/O</a>]]
</div>
<div class="logo">
<a href="http://www.cppreference.com" name="dokuwiki__top" id="dokuwiki__top" accesskey="h" title="[ALT+H]">C++ Reference</a> </div>
<div class="clearer"></div>
</div>
<div class="breadcrumbs">
<span class="bchead">You are here: </span><a href="../../start.html" title="start">C++ Reference</a> &raquo; <a href="../../c/start.html" title="c:start">The Standard C Library</a> &raquo; <a href="../../c/io/start.html" title="c:io:start">Standard C I/O</a> </div>
</div>
<div class="plugin_translation"><span>Translations of this page<sup><a href="../../localization.html" class="wikilink1" title="localization">?</a></sup>:</span> <ul> <li><div class="li"><span class="curid"><a href="../../c/io/start.html" class="wikilink1" title="c:io:start">en</a></span></div></li> <li><div class="li"><a href="../../br-pt/c/io/start.html" class="wikilink1" title="br-pt:c:io:start">br-pt</a></div></li> <li><div class="li"><a href="../../cn/c/io/start.html" class="wikilink1" title="cn:c:io:start">cn</a></div></li> <li><div class="li"><a href="../../cz/c/io/start.html" class="wikilink2" title="cz:c:io:start" rel="nofollow">cz</a></div></li> <li><div class="li"><a href="../../de/c/io/start.html" class="wikilink1" title="de:c:io:start">de</a></div></li> <li><div class="li"><a href="../../es/c/io/start.html" class="wikilink2" title="es:c:io:start" rel="nofollow">es</a></div></li> <li><div class="li"><a href="../../fr/c/io/start.html" class="wikilink1" title="fr:c:io:start">fr</a></div></li> <li><div class="li"><a href="../../it/c/io/start.html" class="wikilink2" title="it:c:io:start" rel="nofollow">it</a></div></li> <li><div class="li"><a href="../../jp/c/io/start.html" class="wikilink1" title="jp:c:io:start">jp</a></div></li> <li><div class="li"><a href="../../nl/c/io/start.html" class="wikilink2" title="nl:c:io:start" rel="nofollow">nl</a></div></li> <li><div class="li"><a href="../../pl/c/io/start.html" class="wikilink2" title="pl:c:io:start" rel="nofollow">pl</a></div></li> <li><div class="li"><a href="../../ro/c/io/start.html" class="wikilink2" title="ro:c:io:start" rel="nofollow">ro</a></div></li> <li><div class="li"><a href="../../ru/c/io/start.html" class="wikilink2" title="ru:c:io:start" rel="nofollow">ru</a></div></li> <li><div class="li"><a href="../../sk/c/io/start.html" class="wikilink2" title="sk:c:io:start" rel="nofollow">sk</a></div></li> <li><div class="li"><a href="../../tr/c/io/start.html" class="wikilink2" title="tr:c:io:start" rel="nofollow">tr</a></div></li> <li><div class="li"><a href="../../tw/c/io/start.html" class="wikilink2" title="tw:c:io:start" rel="nofollow">tw</a></div></li></ul></div>
<div class="page">
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2828341-1";
urchinTracker();
</script>
<!-- wikipage start -->
<h1><a name="standard_c_io" id="standard_c_io">Standard C I/O</a></h1>
<div class="level1">
<p>
These functions provide an alternative to the <a href="../../io/start.html" class="wikilink1" title="io:start">C++ stream-based IO classes</a>.
</p>
<table class="inline">
<tr class="row0">
<td class="col0"><a href="../../c/io/clearerr.html" class="wikilink1" title="c:io:clearerr">clearerr</a></td><td class="col1">clears errors</td>
</tr>
<tr class="row1">
<td class="col0"><a href="../../c/io/fclose.html" class="wikilink1" title="c:io:fclose">fclose</a></td><td class="col1">close a file</td>
</tr>
<tr class="row2">
<td class="col0"><a href="../../c/io/feof.html" class="wikilink1" title="c:io:feof">feof</a></td><td class="col1">true if at the end-of-file</td>
</tr>
<tr class="row3">
<td class="col0"><a href="../../c/io/ferror.html" class="wikilink1" title="c:io:ferror">ferror</a></td><td class="col1">checks for a file error</td>
</tr>
<tr class="row4">
<td class="col0"><a href="../../c/io/fflush.html" class="wikilink1" title="c:io:fflush">fflush</a></td><td class="col1">writes the contents of the output buffer</td>
</tr>
<tr class="row5">
<td class="col0"><a href="../../c/io/fgetc.html" class="wikilink1" title="c:io:fgetc">fgetc</a></td><td class="col1">get a character from a stream</td>
</tr>
<tr class="row6">
<td class="col0"><a href="../../c/io/fgetpos.html" class="wikilink1" title="c:io:fgetpos">fgetpos</a></td><td class="col1">get the file position indicator</td>
</tr>
<tr class="row7">
<td class="col0"><a href="../../c/io/fgets.html" class="wikilink1" title="c:io:fgets">fgets</a></td><td class="col1">get a string of characters from a stream</td>
</tr>
<tr class="row8">
<td class="col0"><a href="../../c/io/fopen.html" class="wikilink1" title="c:io:fopen">fopen</a></td><td class="col1">open a file</td>
</tr>
<tr class="row9">
<td class="col0"><a href="../../c/io/fprintf.html" class="wikilink1" title="c:io:fprintf">fprintf</a></td><td class="col1">print formatted output to a file</td>
</tr>
<tr class="row10">
<td class="col0"><a href="../../c/io/fputc.html" class="wikilink1" title="c:io:fputc">fputc</a></td><td class="col1">write a character to a file</td>
</tr>
<tr class="row11">
<td class="col0"><a href="../../c/io/fputs.html" class="wikilink1" title="c:io:fputs">fputs</a></td><td class="col1">write a string to a file</td>
</tr>
<tr class="row12">
<td class="col0"><a href="../../c/io/fread.html" class="wikilink1" title="c:io:fread">fread</a></td><td class="col1">read from a file</td>
</tr>
<tr class="row13">
<td class="col0"><a href="../../c/io/freopen.html" class="wikilink1" title="c:io:freopen">freopen</a></td><td class="col1">open an existing stream with a different name</td>
</tr>
<tr class="row14">
<td class="col0"><a href="../../c/io/fscanf.html" class="wikilink1" title="c:io:fscanf">fscanf</a></td><td class="col1">read formatted input from a file</td>
</tr>
<tr class="row15">
<td class="col0"><a href="../../c/io/fseek.html" class="wikilink1" title="c:io:fseek">fseek</a></td><td class="col1">move to a specific location in a file</td>
</tr>
<tr class="row16">
<td class="col0"><a href="../../c/io/fsetpos.html" class="wikilink1" title="c:io:fsetpos">fsetpos</a></td><td class="col1">move to a specific location in a file</td>
</tr>
<tr class="row17">
<td class="col0"><a href="../../c/io/ftell.html" class="wikilink1" title="c:io:ftell">ftell</a></td><td class="col1">returns the current file position indicator</td>
</tr>
<tr class="row18">
<td class="col0"><a href="../../c/io/fwrite.html" class="wikilink1" title="c:io:fwrite">fwrite</a></td><td class="col1">write to a file</td>
</tr>
<tr class="row19">
<td class="col0"><a href="../../c/io/getc.html" class="wikilink1" title="c:io:getc">getc</a></td><td class="col1">read a character from a file</td>
</tr>
<tr class="row20">
<td class="col0"><a href="../../c/io/getchar.html" class="wikilink1" title="c:io:getchar">getchar</a></td><td class="col1">read a character from stdin</td>
</tr>
<tr class="row21">
<td class="col0"><a href="../../c/io/gets.html" class="wikilink1" title="c:io:gets">gets</a></td><td class="col1">read a string from stdin</td>
</tr>
<tr class="row22">
<td class="col0"><a href="../../c/io/perror.html" class="wikilink1" title="c:io:perror">perror</a></td><td class="col1">displays a string version of the current error to stderr</td>
</tr>
<tr class="row23">
<td class="col0"><a href="../../c/io/printf.html" class="wikilink1" title="c:io:printf">printf</a></td><td class="col1">write formatted output to stdout</td>
</tr>
<tr class="row24">
<td class="col0"><a href="../../c/io/putc.html" class="wikilink1" title="c:io:putc">putc</a></td><td class="col1">write a character to a stream</td>
</tr>
<tr class="row25">
<td class="col0"><a href="../../c/io/putchar.html" class="wikilink1" title="c:io:putchar">putchar</a></td><td class="col1">write a character to stdout</td>
</tr>
<tr class="row26">
<td class="col0"><a href="../../c/io/puts.html" class="wikilink1" title="c:io:puts">puts</a></td><td class="col1">write a string to stdout</td>
</tr>
<tr class="row27">
<td class="col0"><a href="../../c/io/remove.html" class="wikilink1" title="c:io:remove">remove</a></td><td class="col1">erase a file</td>
</tr>
<tr class="row28">
<td class="col0"><a href="../../c/io/rename.html" class="wikilink1" title="c:io:rename">rename</a></td><td class="col1">rename a file</td>
</tr>
<tr class="row29">
<td class="col0"><a href="../../c/io/rewind.html" class="wikilink1" title="c:io:rewind">rewind</a></td><td class="col1">move the file position indicator to the beginning of a file</td>
</tr>
<tr class="row30">
<td class="col0"><a href="../../c/io/scanf.html" class="wikilink1" title="c:io:scanf">scanf</a></td><td class="col1">read formatted input from stdin</td>
</tr>
<tr class="row31">
<td class="col0"><a href="../../c/io/setbuf.html" class="wikilink1" title="c:io:setbuf">setbuf</a></td><td class="col1">set the buffer for a specific stream</td>
</tr>
<tr class="row32">
<td class="col0"><a href="../../c/io/setvbuf.html" class="wikilink1" title="c:io:setvbuf">setvbuf</a></td><td class="col1">set the buffer and size for a specific stream</td>
</tr>
<tr class="row33">
<td class="col0"><a href="../../c/io/snprintf.html" class="wikilink1" title="c:io:snprintf">snprintf</a></td><td class="col1">write formated output to a buffer (with bound checking)</td>
</tr>
<tr class="row34">
<td class="col0"><a href="../../c/io/sprintf.html" class="wikilink1" title="c:io:sprintf">sprintf</a></td><td class="col1">write formatted output to a buffer</td>
</tr>
<tr class="row35">
<td class="col0"><a href="../../c/io/sscanf.html" class="wikilink1" title="c:io:sscanf">sscanf</a></td><td class="col1">read formatted input from a buffer</td>
</tr>
<tr class="row36">
<td class="col0"><a href="../../c/io/tmpfile.html" class="wikilink1" title="c:io:tmpfile">tmpfile</a></td><td class="col1">return a pointer to a temporary file</td>
</tr>
<tr class="row37">
<td class="col0"><a href="../../c/io/tmpnam.html" class="wikilink1" title="c:io:tmpnam">tmpnam</a></td><td class="col1">return a unique filename</td>
</tr>
<tr class="row38">
<td class="col0"><a href="../../c/io/ungetc.html" class="wikilink1" title="c:io:ungetc">ungetc</a></td><td class="col1">puts a character back into a stream</td>
</tr>
<tr class="row39">
<td class="col0"><a href="../../c/io/vprintf_vfprintf_vsprintf.html" class="wikilink1" title="c:io:vprintf_vfprintf_vsprintf">vprintf, vfprintf, and vsprintf</a></td><td class="col1">write formatted output with variable argument lists</td>
</tr>
<tr class="row40">
<td class="col0"><a href="../../c/io/vscanf_vfscanf_vsscanf.html" class="wikilink1" title="c:io:vscanf_vfscanf_vsscanf">vscanf, vfscanf, and vsscanf</a></td><td class="col1">gets formatted input from stdin with variable argument lists</td>
</tr>
</table>
</div>
<!-- wikipage stop -->
</div>
<div class="clearer">&nbsp;</div>
<div class="stylefoot">
<div class="meta">
<div class="user">
</div>
<!--
<div class="doc">
c/io/start.txt &middot; Last modified: 02/17/2009 07:33 by 66.90.155.196 </div>
-->
</div>
<div class="bar" id="bar__bottom">
<div class="bar-left" id="bar__bottomleft">
<a href="../../c/io/start.html" class="action edit" accesskey="e" rel="nofollow">Edit this page</a> &#149;
<a href="../../c/io/start.html" class="action revisions" accesskey="o" rel="nofollow">Old revisions</a> </div>
<div class="bar-right" id="bar__bottomright">
&#149;
&#149;
&#149;
<a href="../../c/io/start.html" class="action login" rel="nofollow">Login</a> &#149;
<a href="../../c/io/start.html" class="action index" accesskey="x" rel="nofollow">Index</a> &#149;
<a href="../../c/io/start.html" class="action recent" accesskey="r" rel="nofollow">Recent changes</a> &#149;
<a href="../../feed.php.html" title="Recent changes RSS feed">RSS</a> &#149;
<a href='http://creativecommons.org/licenses/by/3.0/us/' title='Creative Commons license'>cc</a> &#149;
<form action="/wiki/" accept-charset="utf-8" class="search" id="dw__search"><div class="no"><input type="hidden" name="do" value="search" /><input type="text" id="qsearch__in" accesskey="f" name="id" class="edit" title="[ALT+F]" /><input type="submit" value="Search" class="button" title="Search" /><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>&nbsp;
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="no"><img src="/wiki/lib/exe/indexer.php?id=c%3Aio%3Astart&amp;1273193076" width="1" height="1" alt="" /></div>
</body>
</html>