ProAnswers.org

How to get files size in C?

try below code

fseek(f, 0, SEEK_END); // seek to end of file
fileSize = ftell(f); // get file size
fseek(f, 0, SEEK_SET); // seek back to beginning of file