get file size in C





2
Date Submitted Sun. Feb. 1st, 2009 10:12 AM
Revision 1 of 1
Beginner ckoder
Tags C | File | find | in | Size
Comments 0 comments
This simple function utility is used to find file size in bytes


//get file size
#include<stdio.h>
int getFileSize(FILE *input)
{
    int fileSizeBytes;
    fseek(input, 0, SEEK_END);
    fileSizeBytes = ftell(input);
    fseek(input, 0, SEEK_SET);
    return fileSizeBytes;
}
//This utility is used to get filesize in bytes

 

ckoder c

Comments

There are currently no comments for this snippet.

Voting

Votes Up


Beginner ckoder
Scripter elsevero

Votes Down