📄 fg
字号:
@c ----------------------------------------------------------------------
@node fgetc, stdio
@heading @code{fgetc}
@subheading Syntax
@example
#include <stdio.h>
int fgetc(FILE *file);
@end example
@subheading Description
Returns the next character in the given @var{file} as an unsigned char.
@subheading Return Value
The given char (value 0..255) or @code{EOF} at end-of-file.
@subheading Example
@example
int c;
while((c=fgetc(stdin)) != EOF)
fputc(c, stdout);
@end example
@c ----------------------------------------------------------------------
@node fgetgrent, unix
@heading @code{fgetgrent}
@subheading Syntax
@example
#include <grp.h>
struct group *fgetgrent(FILE *file);
@end example
@subheading Description
This function, in MS-DOS, is exactly the same as getgrent
(@pxref{getgrent}).
@c ----------------------------------------------------------------------
@node fgetpos, stdio
@heading @code{fgetpos}
@subheading Syntax
@example
#include <stdio.h>
int fgetpos(FILE *file, fpos_t *offset);
@end example
@subheading Description
This function records the current file pointer for @var{file}, for
later use by @code{fsetpos}.
@xref{fsetpos}.
@xref{ftell}.
@subheading Return Value
Zero if successful, nonzero if not.
@c ----------------------------------------------------------------------
@node fgetpwent, unix
@heading @code{fgetpwent}
@subheading Syntax
@example
#include <pwd.h>
struct passwd *fgetpwent(FILE *file);
@end example
@subheading Description
This function, in MS-DOS, is exactly like @code{getpwent}
(@pxref{getpwent}).
@c ----------------------------------------------------------------------
@node fgets, stdio
@heading @code{fgets}
@subheading Syntax
@example
#include <stdio.h>
char *fgets(char *buffer, int maxlength, FILE *file);
@end example
@subheading Description
This function reads as much of a line from a file as possible, stopping
when the buffer is full (@var{maxlength}-1 characters), an end-of-line
is detected, or @code{EOF} or an error is detected. It then stores a
@code{NULL} to terminate the string.
@subheading Return Value
The address of the buffer is returned on success, if @code{EOF} is
encountered before any characters are stored, or if an error is
detected, @code{NULL} is returned instead.
@subheading Example
@example
char buf[100];
while (fgets(buf, 100, stdin))
fputs(buf, stdout);
@end example
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -