ferror、feof、clearerr、fileno

来源:互联网 发布:q移动软件工作室 编辑:程序博客网 时间:2024/06/06 01:28

ferror, feof, clearerr, fileno - check and reset stream status

#include <stdio.h>int ferror(FILE *stream);  //true if it's errorint feof(FILE *stream);    //true if it's eof//Both Return: nonzero(true) if true, 0(false) if falsevoid clearerr(FILE *stream); //clear both flagsint fileno(FILE *stream);

FILE object中有两个标志位(flags

  • An error flag
  • An end-of-file flag

clearerr能清除所有标志位

fileno() examines the argument stream and returns its integer descriptor.(检测stream流,并且返回整数描述符)

0 0
原创粉丝点击