fgetc.c

来自「标准c库代码,可以应用于各个系统提供了大量的基本函数」· C语言 代码 · 共 47 行

C
47
字号
/*FUNCTION<<fgetc>>---get a character from a file or streamINDEX	fgetcANSI_SYNOPSIS	#include <stdio.h>	int fgetc(FILE *<[fp]>);TRAD_SYNOPSIS	#include <stdio.h>	int fgetc(<[fp]>)	FILE *<[fp]>;DESCRIPTIONUse <<fgetc>> to get the next single character from the file or streamidentified by <[fp]>.  As a side effect, <<fgetc>> advances the file'scurrent position indicator.For a macro version of this function, see <<getc>>.RETURNSThe next character (read as an <<unsigned char>>, and cast to<<int>>), unless there is no more data, or the host system reports aread error; in either of these situations, <<fgetc>> returns <<EOF>>.You can distinguish the two situations that cause an <<EOF>> result byusing the <<ferror>> and <<feof>> functions.PORTABILITYANSI C requires <<fgetc>>.Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,<<lseek>>, <<read>>, <<sbrk>>, <<write>>.*/#include <stdio.h>int_DEFUN (fgetc, (fp),	FILE * fp){  return __sgetc (fp);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?