I am getting back into coding after a long break. Every time I run this code, the else block is always running. Yes, I have the correct pathing to the file, I tested it by writing to the file, and verified the file was indeed updated. What is going on here?
terminate called after throwing an instance of 'std::invalid_argument'
what(): Could not find file 'Difficulties.txt'.
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Process returned 3 (0x3) execution time : 1.665 s
Press any key to continue.
Do you know that there are other reasons for the file to fail to open properly, other than not finding the file? Perhaps you should ask your system for more information as to why the open failed. Try using perror() to help determine the cause of the failure. http://www.cplusplus.com/reference/cstdio/perror/