feof()与eof()有什么区别?

如题所述

feof()的参数是一个文件指针.

eof()的参数是一个文件描述符.

************************************************

文件操作函数中,名称以f开头的(如fopen(),feof()等),都是通过缓冲区来进行文件操作的称为流式文件操作.

不是f开头的(如open(),eof()等),都是直接文件操作函数.
温馨提示:答案为网友推荐,仅供参考
第1个回答  2008-08-08
all the messages

feof
Tests for end-of-file on a stream.

The feof function returns a nonzero value after the first read operation that attempts to read past the end of the file. It returns 0 if the current position is not end of file. There is no error return.

ios::eof
int eof() const;

Return Value

Returns a nonzero value if end of file has been reached. This is the same as setting the eofbit error flag.

basic_ios::eof
bool eof() const;
The member function returns true if rdstate() & eofbit.

char_traits::eof
static int_type eof();
The static member function returns a value that represents end-of-file (such as EOF or WEOF). If the value is also representable as type E, it must correspond to no valid value of that type.

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网