/*-------------------------------------------------------------------
Returns a boolean indicating if a file is empty (true) or not (false)
-------------------------------------------------------------------*/
bool FileIsEmpty(string Filepath)
{
struct stat buffer;
stat(Filepath.c_str(), &buffer);
return (buffer.st_size == 0);
}
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream file("myfile.txt");
file.seekg(0,ios::end); // points to the end of file
int length = file.tellg(); // returns the end of file's index , if its 0 then the file is empty
}