How can I figure out the size of a file, in bytes?
#include unsigned int fsize(char* file){ //what goes here? }
Here's a simple and clean function that returns the file size.
long get_file_size(char *path) { FILE *fp; long size = -1; /* Open file for reading */ fp = fopen(path, "r"); fseek(fp, 0, SEEK_END); size = ftell(fp); fp.close(); return }