So, I'm trying to read a file, but the file isn't opening... I have no ideia why, can't see any problem with what I've done...
I have a class Board and I read the file in the constructor like this:
Using this, it always triggers the "Error" message...
I have the file "t1" in the correct directory.
I really don't know what's wrong with this...
If anyone can help me, I would be really apreciated! :D
Are you sure. The file is located in the "current working directory"? Note that it's not necessary the same as the directory where the executable file is located and it can differ depending on how you start executing your program.
You are trying to open "t1.txt" so that must be the name of the file. If the file is named simply "t1" it will not work.