|
|
1.1 root 1: .TH FGETS 3S
2: .CT 2 file_io
3: .SH NAME
4: fgets, puts, fputs, gets \(mi string input/out on streams
5: .SH SYNOPSIS
6: .nf
7: .B #include <stdio.h>
8: .PP
9: .B char *fgets(s, n, stream)
10: .B char *s;
11: .B FILE *stream;
12: .PP
13: .B int puts(s)
14: .B char *s;
15: .PP
16: .B int fputs(s, stream)
17: .B char *s;
18: .B FILE *stream;
19: .fi
20: .SH DESCRIPTION
21: .I Fgets
22: reads
23: .IR n \-1
24: characters, or up to a newline
25: character, whichever comes first,
26: from the
27: .I stream
28: into the string
29: .IR s .
30: The last character read into
31: .I s
32: is followed by a null character.
33: .I Fgets
34: returns its first argument.
35: .PP
36: .I Puts
37: copies the null-terminated string
38: .I s
39: to the standard output stream
40: .I stdout
41: and appends a
42: newline character.
43: .PP
44: .I Fputs
45: copies the null-terminated string
46: .I s
47: to the named output
48: .IR stream .
49: .PP
50: Neither routine copies the terminal null character.
51: Both return the result of calling
52: .IR putc
53: with the last character written; see
54: .IR getc (3).
55: .SH "SEE ALSO"
56: .IR getc (3)
57: .IR stdio (3)
58: .SH DIAGNOSTICS
59: .IR Fgets
60: returns a null pointer
61: upon end of file or error.
62: .SH BUGS
63: For safety reasons the
64: .SM ANSI
65: standard function
66: .BR "char *gets(s)" ,
67: which reads from standard input up to a newline and
68: discards the newline, is not supported.
69: .br
70: .I Puts
71: appends a newline,
72: .I fputs
73: does not, all in the name of backward compatibility.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.