首页 > 其他 > 详细

How to Get the Length of File in C

时间:2018-02-03 17:14:43      阅读:213      评论:0      收藏:0      [点我收藏+]

How to get length of file in C

//===
int fileLen(FILE *fp)
{
    int nRet = -1;
    int nPosBak;

    nPosBak = ftell(fp);///< current position in file

    fseek(fp, 0, SEEK_END);
    nRet = ftell(fp);

    fseek(fp, nPosBak, SEEK_SET);///< write back position to file
    return nRet;
}

How to Get the Length of File in C

原文:https://www.cnblogs.com/zi-xing/p/7725492.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!