fgetc.c
来自「cygwin, 著名的在win32下模拟unix操作系统的东东」· C语言 代码 · 共 51 行
C
51 行
/*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){ int result; _flockfile(fp); result = __sgetc (fp); _funlockfile(fp); return result;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?