Answers for "c++ how to get the size of an open file"

C++
0

how to check size of file in c++

#include <fstream>

std::ifstream::pos_type filesize(const char* filename)
{
    std::ifstream in(filename, std::ifstream::ate | std::ifstream::binary);
    return in.tellg(); 
}
Posted by: Guest on July-18-2021

Code answers related to "c++ how to get the size of an open file"

Browse Popular Code Answers by Language