Answers for "c++ get file size"

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

Browse Popular Code Answers by Language