Skip to content

Instantly share code, notes, and snippets.

View Cewein's full-sized avatar
🌠
Dreaming

Maximilien Nowak Cewein

🌠
Dreaming
View GitHub Profile
@Cewein
Cewein / flen.c
Last active December 9, 2018 18:13 — forked from quantumsheep/flen.c
Calculate a file length. The file need to be in `rb` mode (reading and binary mode)
#include <stdio.h>
int flen(FILE *f)
{
int len;
fseek(f, 0, SEEK_END);
len = ftell(f);
rewind(f)
return len;
}