Wednesday 22 August 2012

Return the size of you file (C++)

That function will return how bytes is you file

int fsize(FILE *file){

    int prev = ftell(file);
    fseek(file, 0L, SEEK_END);
    int size = ftell(file);
    fseek(file,prev,SEEK_SET);
    return size;

}

No comments:

Post a Comment