阅读背景:

How to Get the Length of File in C

来源:互联网 

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;
}//===
int file



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: