如何确定C中文件的大小?如何计算文件的大小(以字节为单位)?#include <stdio.h>unsigned int fsize(char* file){
//what goes here?}
3 回答
LEATH
TA贡献1936条经验 获得超6个赞
unsigned long fsize(char* file){ FILE * f = fopen(file, "r"); fseek(f, 0, SEEK_END); unsigned long len = (unsigned long)ftell(f); fclose(f); return len;}
GetFileSizeEx
stat64
.
- 3 回答
- 0 关注
- 453 浏览
添加回答
举报
0/150
提交
取消