I put the file to open one level up from where the source files and exe output files are, where the VS solution file is and the file is opened just fine.
Why go one level up? Why not use const std::string dataFileLocation = "MP4election.txt";
Depends on how you run your executable. Run from within the VS IDE and the file needs to be in the directory with the source code files. Run from a command prompt, or double click the file, your text file needs to be located where the exe file is.
One level up and no matter how you start your program the text file can be found.
One other thing, you forgot to resync the pointer to the contents of the file back to the beginning. You left it at the end when you retrieved the file size. Your program will never read the contents of the file.
Okay, so I made the changes to the code to use a relative path, and it falls to open. If I add the absolute path, putting the file on the desktop it works? My file structure is: