I'm trying to make a function to get file size. I tried using GetFileSizeEx but I couldn't get results that I wanted (I want it to be an integer or double) and to compare if it's larger than 1MB or not. Anyways, I made this function but I am getting an error that filenamestr is not declared.
int getsize(std::string const $filename);
...
int getsize(std::string const $filenamestr)
{
std::fstream file(filenamestr);
file.seekg(0, std::ios::end);
return file.tellg();
}
What am I doing wrong?