source: trunk/minix/man/man3/gets.3@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.1 KB
Line 
1.\" @(#)gets.3s 6.1 (Berkeley) 5/15/85
2.\"
3.TH GETS 3 "May 15, 1985"
4.AT 3
5.SH NAME
6gets, fgets \- get a string from a stream
7.SH SYNOPSIS
8.nf
9.ft B
10#include <stdio.h>
11
12char *gets(char *\fIs\fP)
13char *fgets(char *\fIs\fP, int \fIn\fP, FILE *\fIstream\fP)
14.ft R
15.fi
16.SH DESCRIPTION
17.B Gets
18reads a string into
19.I s
20from the standard input stream
21.BR stdin .
22The string is terminated by a newline
23character, which is replaced in
24.I s
25by a null character.
26.B Gets
27returns its argument.
28.PP
29.B Fgets
30reads
31.IR n \-1
32characters, or up through a newline
33character, whichever comes first,
34from the
35.I stream
36into the string
37.IR s .
38The last character read into
39.I s
40is followed by a null character.
41.B Fgets
42returns its first argument.
43.SH "SEE ALSO"
44.BR puts (3),
45.BR getc (3),
46.BR scanf (3),
47.BR fread (3),
48.BR ferror (3).
49.SH DIAGNOSTICS
50.B Gets
51and
52.B fgets
53return the constant pointer
54.SM
55.B NULL
56upon end of file or error.
57.SH BUGS
58.B Gets
59deletes a newline,
60.B fgets
61keeps it,
62all in the name of backward compatibility.
63.PP
64.B Gets
65is not present in the Minix-vmd C library for reasons that should be obvious.
66Use
67.B fgets
68instead.
Note: See TracBrowser for help on using the repository browser.