fgetc, fgetchar 的区别

来源:互联网 发布:路由器软件升级好不好 编辑:程序博客网 时间:2024/05/31 19:00

一句话总结:

fgetchar = fgetc(stdin)


以下转载自:http://support.tenasys.com/INtimeHelp_5/fgetc.html

详细说明:

Fgetc reads a single character from the current position of the specified stream and increments the file pointer to the next character; fgetchar reads from stdin.

#include <stdio.h>int fgetc (FILE *stream);int fgetchar (void);

Parameters

stream
Pointer to FILE structure.

Remarks

fgetchar is equivalent to:

fgetc (stdin)

Fgetc and fgetchar are identical to getc and getchar, but they are functions, not macros.

Return Values

The integer value of the character read.
Success.
EOF on error or end-of-file.
Since EOF is a legal integer value, use feof or ferror to distinguish between an error and an end-of-file condition.

Requirements

VersionsDefined inIncludeLink toINtime 3.0intime/rt/include/stdio.hstdio.hclib.lib

See Also

feof, ferror, fputc, fputchar, getc, getchar


0 0
原创粉丝点击