开发者

how do I know if binary file is empty in C [duplicate]

This question already has answers here: 开发者_运维知识库 Closed 11 years ago.

Possible Duplicate:

How can I get a file's size in C?

how do I know if binary file is empty in C?


// assume file is opened as FILE *fp
fseek(fp, 0L, SEEK_END);
bool empty = ftell(fp) == 0L;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜