blob: c5f438e616195e5bf3af1452f3b6619afa14327b [file]
<html lang="en">
<head>
<title>fputs - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Stdio.html#Stdio" title="Stdio">
<link rel="prev" href="fputc.html#fputc" title="fputc">
<link rel="next" href="fputwc.html#fputwc" title="fputwc">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="fputs"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="fputwc.html#fputwc">fputwc</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="fputc.html#fputc">fputc</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Stdio.html#Stdio">Stdio</a>
<hr>
</div>
<h3 class="section">4.21 <code>fputs</code>&mdash;write a character string in a file or stream</h3>
<p><a name="index-fputs-186"></a><a name="index-g_t_005ffputs_005fr-187"></a><strong>Synopsis</strong>
<pre class="example"> #include &lt;stdio.h&gt;
int fputs(const char *<var>s</var>, FILE *<var>fp</var>);
#include &lt;stdio.h&gt;
int _fputs_r(struct _reent *<var>ptr</var>, const char *<var>s</var>, FILE *<var>fp</var>);
</pre>
<p><strong>Description</strong><br>
<code>fputs</code> writes the string at <var>s</var> (but without the trailing null)
to the file or stream identified by <var>fp</var>.
<p><code>_fputs_r</code> is simply the reentrant version of <code>fputs</code> that takes
an additional reentrant struct pointer argument: <var>ptr</var>.
<p><br>
<strong>Returns</strong><br>
If successful, the result is <code>0</code>; otherwise, the result is <code>EOF</code>.
<p><br>
<strong>Portability</strong><br>
ANSI C requires <code>fputs</code>, but does not specify that the result on
success must be <code>0</code>; any non-negative value is permitted.
<p>Supporting OS subroutines required: <code>close</code>, <code>fstat</code>, <code>isatty</code>,
<code>lseek</code>, <code>read</code>, <code>sbrk</code>, <code>write</code>.
<p><br>
</body></html>