if (inputFile.fail())
cout << "Sorry, I couldn't find the file.";
else
{
while (inputFile >> N)
{
M++;
T+=N;
}
if (M>0)
A = T/M;
else
A=0.0;
cout << "There are " << M << " numbers in this file.\n";
cout <<"There are" << T << "when added together.\n";
cout << A << "is the average number in your file.";
In a C++ string, the "\" character is used to enter special characters. Think '\n' for example. Unfortunately, microsoft also chose this character to separate directories in a path. So in this string "C:\Users\Eevee\Documents\randomnumbersc++.docx" each '\' is an escape and the string that actually gets compiled is not what you expect.
To solve this, you have to escape the \ character itself. Change the string to "C:\\Users\\Eevee\\Documents\\randomnumbersc++.docx"
Just FYI: Windows core functions accepts forward slash '/' as directory separator. However they do not accept it in command line, so you should not use it with, say, system() calls.