zoukankan      html  css  js  c++  java
  • C语言常用函数-filelength()文件字节数统计函数

    演示版本

    VS2012

    • filelength()函数

    filelength()函数用于统计由open()所打开文件的字节数。

    语法

    int filelength(int handle);

    filelength()函数的语法参数说明如下:

    参数handle为要统计的文件句柄。

    filelength()函数返回打开文件的长度。

    示例

    #include <io.h>
    #include <fcntl.h>
    #include <stdio.h>
    
    int main()
    {
        int file;
        long length;
        FILE *fp;
        fp = fopen("d:\1\1\1.txt", "r");
        file = _dup(_fileno(fp));
        length = _filelength(file);
        printf("%ld
    ", length);
        fclose(fp);
    }

    阿飞

    2021年8月3日

  • 相关阅读:
    WEEK
    更新yum源
    Centos6.9安装Mysql5.7.18
    gitlab使用
    gitlab安装
    git客户端
    服务器端配置
    错误问题
    服务器端
    01找出数组中重复的数
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/15096682.html
Copyright © 2011-2022 走看看