本文為原創(chuàng)文章,轉(zhuǎn)載請標明出處
#include <stdio.h>
#include <stdlib.h>
int main() {
FILE *inputFile;
inputFile = fopen("data.bin", "rb");
if (!inputFile) {
fprintf(stderr, "Can't open bin file!");
exit(1);
}
fseek(inputFile, 0, SEEK_END);
long inputFileLength = ftell(inputFile);
printf("input file length: %ld\n", inputFileLength);
fseek(inputFile, 0, SEEK_SET);
fclose(inputFile);
return 0;
}