-
-
Save Cewein/87fdab476a3a40629156388837cc2357 to your computer and use it in GitHub Desktop.
Calculate a file length. The file need to be in `rb` mode (reading and binary mode)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int flen(FILE *f) | |
{ | |
int len; | |
fseek(f, 0, SEEK_END); | |
len = ftell(f); | |
rewind(f) | |
return len; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment