<p>How can I figure out the size of a file, in bytes?</p>

<pre><code>#include &lt;stdio.h&gt;

unsigned int fsize(char* file){
  //what goes here?
}
</code></pre>

If you're fine with using the std c library:
```
```
#include <sys/stat.h>
off_t fsize(char *file) {
    struct stat filestat;
    if (stat(file, &filestat) == 0) {
        return filestat.st_size;
    }
    return 0;
}
```
```