How to Get the Length of File in C

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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;
}

以上是关于How to Get the Length of File in C的主要内容,如果未能解决你的问题,请参考以下文章

How to Pronounce the Months of the Year

How to use the function of assembly.

How to Prolong the Service Life of Cone Crusher

How to show the first few errors of rustc

The best manual of how to use "The easiest Xdebug" addon for Firefox

How To Determine The Cause Of Lots Of Redo Generation Using LogMiner (Doc ID 300395.1)