If you would rather use the old C standard then you could do this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <cstdio>// Used for the file handling
usingnamespace std;// We want to specify the standard namespace
// The start of the sample program
int main() {// Look up
// Change the file to the one you want to read
FILE* NewFile = fopen("Text.dat","rb");// Open the file for reading in binary mode
if((NewFile != NULL) ||// If we could not open the file
(fgetc(NewFile) == EOF)) {// Or if the file realy is empty
fclose(NewFile);// Close the file
return 0;// Close the program
} else {// If the file is not empty
fseek(NewFile,-1,SEEK_CUR);// Unread that character
// Do what ever else you want to do with that file
}// End of If statement
}// End of main(void)