Mercurial > hg > Members > kono > nitros9-code
view docs/ccguide/gets.refentry @ 3250:13737f3608e6
Updated Level 1 VTIO and CoVDG for updates to do CoCoVGA.
Updated Level 1 CoCo1 area makefile's to produce binaries and disk images needed
for the CoCoVGA video output.
author | David Ladd <drencor-xeen@users.sourceforge.net> |
---|---|
date | Wed, 28 Mar 2018 21:20:31 -0500 |
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 <stdio.h> </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>