annotate docs/ccguide/gets.refentry @ 598:a74b8d8c28db

All refentries finished.
author roug
date Fri, 15 Nov 2002 21:49:51 +0000
parents 253b6096ee01
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
1 <refentry id="gets">
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
2 <refnamediv>
570
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
3 <refname>Gets</refname>
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
4 <refname>Fgets</refname>
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
5 <refpurpose>input a string</refpurpose>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
6 </refnamediv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
7
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
8 <refsynopsisdiv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
9 <funcsynopsis>
468
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
10 <funcsynopsisinfo>
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
11 #include &lt;stdio.h&gt;
60b821f18853 A little here and there.
roug
parents: 466
diff changeset
12 </funcsynopsisinfo>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
13 <funcprototype>
570
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
14 <funcdef>char *<function>gets</function></funcdef>
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
15 <paramdef>char *<parameter>s</parameter></paramdef>
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
16 </funcprototype>
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
17
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
18 <funcprototype>
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
19 <funcdef>char *<function>fgets</function></funcdef>
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
20 <paramdef>char *<parameter>s</parameter></paramdef>
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
21 <paramdef>int <parameter>n</parameter></paramdef>
253b6096ee01 All function prototypes are added.
roug
parents: 552
diff changeset
22 <paramdef>FILE *<parameter>fp</parameter></paramdef>
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
23 </funcprototype>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
24 </funcsynopsis>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
25
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
26 </refsynopsisdiv>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
27
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
28 <refsect1><title>Description</title>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
29 <para>
598
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
30 Fgets reads characters from the file "fp" and places them in
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
31 the buffer pointed to by "s" up to a carriage return ('\n') but
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
32 not more than "n" - 1 characters. A null character is appended
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
33 to the end of the string.
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
34 </para>
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
35 <para>
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
36 Gets is similar to fgets, but gets is applied to "stdin" and no
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
37 maximum is stipulated and '\n' is replaced by a null.
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
38 </para>
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
39 <para>
a74b8d8c28db All refentries finished.
roug
parents: 570
diff changeset
40 Both functions return their first arguments.
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
41 </para>
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
42 </refsect1>
542
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
43
552
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
44 <refsect1><title>Caveats</title>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
45 <para>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
46 The different treatment of the "\n" by these functions is
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
47 retained here for portability reasons.
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
48 </para>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
49 </refsect1>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
50
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
51 <refsect1><title>Diagnostics</title>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
52 <para>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
53 Both functions return NULL on end-of-file or error.
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
54 </para>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
55 </refsect1>
fcb97f0ba24b All diagnostics added.
roug
parents: 542
diff changeset
56
542
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
57 <refsect1><title>See Also</title>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
58 <para>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
59 <link linkend="puts">puts()</link>,
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
60 <link linkend="getc">getc()</link>,
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
61 <link linkend="scanf">scanf()</link>,
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
62 <link linkend="fread">fread()</link>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
63 </para>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
64 </refsect1>
73319ee6a57e All "See Also" implemented
roug
parents: 468
diff changeset
65
466
bea58398bb15 Skeletons for the C Compiler User's Guide, 1983
roug
parents:
diff changeset
66 </refentry>