📄 gets.3s
字号:
.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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -