#include <fstream>
#include <iostream>
//Bear in mind that the text file is already in the resources file
int main()
{
ifstream file("Hamlet.txt", ios::in);//open file
if (file.is_open() == true) cout << "File is open" << endl;
else if (file.is_open() == false) cout << "File isnt open" << endl;
return 0;
}
So I'm trying to see if the file is open or not, the text file is in the resources file so as far as I know the path of the file can be written as "Hamlet.txt" . I keep getting File isnt open, what may be the reason? Can anyone bring an explanation to this? Thanks in advance