gets.3s
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3S 代码 · 共 71 行
3S
71 行
.\" SCCSID: @(#)gets.3s 8.2 1/28/91.TH gets 3s .SH Namegets, fgets \- get a string from a stream.SH Syntax.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.B int n;.br.SM.B FILE.B *stream;.SH Description.NXR "gets subroutine".NXR "fgets subroutine".NXR "stream" "getting string from"The.PN getsroutine reads a string into.I sfrom the standard input stream.BR stdin .The string is terminated by a newlinecharacter, which is replaced in.I sby a null character.The.PN getsroutine returns its argument..PPThe.PN fgetsroutine reads .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.The.PN fgetsroutine returns its first argument..SH RestrictionsThe.PN getsroutine deletes a newline,while.PN fgetskeeps it..SH DiagnosticsThe.PN getsand.PN fgetsroutines return the constant pointer NULLupon end of file or error..SH See Alsoferror(3s), fread(3s), getc(3s), puts(3s), scanf(3s)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?