For small (less than 2 GB files), fseek() and ftell() works good on getting file size.
(Technically the file size needs to fit in signed int variable to work.)

seek to file end and get the size....