1234
std::ifstream file(filename,std::ios::binary|std::ios::ate); size_t filesize=file.tellg(); file.seekg(0); //filesize contains the file size, unsurprisingly.