view docs/ccguide/gets.refentry @ 2798:b70d93f8d7ce lwtools-port

Updated coco1/modules/makefile and coco3/modules/makefile to help resolve issues with i(x) and s(x) descriptors. Updated level1/coco1/modules/makefile & level2/coco3/modules/makefile so that correct values would be sent to assembler when building superdesc.asm for s(x).dd and i(x).dd descriptors.
author drencor-xeen
date Mon, 28 Jan 2013 16:13:05 -0600
parents a74b8d8c28db
children
line wrap: on
line source

<refentry id="gets">
<refnamediv>
<refname>Gets</refname>
<refname>Fgets</refname>
<refpurpose>input a string</refpurpose>
</refnamediv>

<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>
#include &lt;stdio.h&gt;
</funcsynopsisinfo>
<funcprototype>
  <funcdef>char *<function>gets</function></funcdef>
  <paramdef>char *<parameter>s</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef>char *<function>fgets</function></funcdef>
  <paramdef>char *<parameter>s</parameter></paramdef>
  <paramdef>int <parameter>n</parameter></paramdef>
  <paramdef>FILE *<parameter>fp</parameter></paramdef>
</funcprototype>
</funcsynopsis>

</refsynopsisdiv>

<refsect1><title>Description</title>
<para>
Fgets reads characters from the file "fp" and places them in
the buffer pointed to by "s" up to a carriage return ('\n') but
not more than "n" - 1 characters. A null character is appended
to the end of the string.
</para>
<para>
Gets is similar to fgets, but gets is applied to "stdin" and no
maximum is stipulated and '\n' is replaced by a null.
</para>
<para>
Both functions return their first arguments.
</para>
</refsect1>

<refsect1><title>Caveats</title>
<para>
The different treatment of the "\n" by these functions is
retained here for portability reasons.
</para>
</refsect1>

<refsect1><title>Diagnostics</title>
<para>
Both functions return NULL on end-of-file or error.
</para>
</refsect1>

<refsect1><title>See Also</title>
<para>
<link linkend="puts">puts()</link>,
<link linkend="getc">getc()</link>,
<link linkend="scanf">scanf()</link>,
<link linkend="fread">fread()</link>
</para>
</refsect1>

</refentry>