unsigned long long get_file_size(const std::string& filename)
{
ifstream fin(filename);
fin.seekg(0, fin.end);
auto fos = fin.tellg();
unsigned long long filesize = fos;
return filesize;
}
unsigned long long get_file_size(ifstream& fin)
{
fin.seekg(0, fin.end);
auto fos = fin.tellg();
unsigned long long filesize = fos;
return filesize;
}
C++ ifstream获取文件大小
于 2022-07-04 13:53:41 首次发布