title: Cannot open a text file though it is in my resources file
body: <pre><code>#include &lt;fstream&gt;
  #include &lt;iostream&gt;
  //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 &lt;&lt; "File is open" &lt;&lt; endl;
        else if (file.is_open() == false) cout &lt;&lt; "File isnt open" &lt;&lt; endl;
        return 0;
  }
  </code></pre>
  
  <p>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</p>