gets.3s
来自「unix v7是最后一个广泛发布的研究型UNIX版本」· 3S 代码 · 共 63 行
3S
63 行
.TH GETS 3S .SH NAMEgets, fgets \- get a string from a stream.SH SYNOPSIS.B #include <stdio.h>.PP.B char *gets(s).br.B char *s;.PP.B char *fgets(s, n, stream).br.B char *s;.br.SM.B FILE.B *stream;.SH DESCRIPTION.I Getsreads a string into.I sfrom the standard input stream.B stdin.The string is terminated by a newlinecharacter, which is replaced in.I sby a null character..I Getsreturns its argument..PP.I Fgetsreads .IR n \-1characters, or up to a newlinecharacter, whichever comes first,from the.I streaminto the string.IR s .The last character read into.I sis followed by a null character..I Fgetsreturns its first argument..SH "SEE ALSO"puts(3),getc(3), scanf(3), fread(3),ferror(3).SH DIAGNOSTICS.I Getsand.I fgetsreturn the constant pointer .SM.B NULLupon end of file or error..SH BUGS.I Getsdeletes a newline,.I fgetskeeps it,all in the name of backward compatibility.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?