I am trying to read file from my pc located at any local disk using c++.For that I have written code.But it is not executing : <p>I am working on file project in that I want to open file using c++ which is located in any drive of my PC.User will enter file location and file name of it.So,only I want to open tat file from that folder.I have wrtten a code.</p>

<pre><code>#include &lt;fstream&gt;
#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;
int main()
{
    string inp,fname;
    ofstream myfile;
    cout&lt;&lt;"Enter path for Input file:";
    getline(cin, inp);
    fstream input&lt;&lt;( "inp",ios::app);      
    myfile.open("Final.txt", ios_base::app);
    myfile &lt;&lt; "Thanks for your help.\n";
    myfile.close();
    return 0;
} 
</code></pre>
