This question already has an answer here:
Let's create a complementary question to this one. What is the most common way to get the file size in C++? Before answering, make sure it is portable (may be executed on Unix, Mac and Windows), reliable, easy to understand and without library dependencies (no boost or qt, but for instance glib is ok since it is portable library).
In c++ you can use following function, it will return the size of you file in bytes.
See http://www.cplusplus.com/doc/tutorial/files/ for more information on files in C++.
Using the C++ filesystem TS:
While not necessarily the most popular method, I've heard that the ftell, fseek method may not always give accurate results in some circumstances. Specifically, if an already opened file is used and the size needs to be worked out on that and it happens to be opened as a text file, then it's going to give out wrong answers.
The following methods should always work as stat is part of the c runtime library on Windows, Mac and Linux.
On some systems there is also a stat64/fstat64. So if you need this for very large files you may want to look at using those.