演示版本
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\n", length); fclose(fp); }
阿飛
2021年8月3日