I'm trying to get this to read a text file that I have and print it out on the screen, when I run it, it shows a blank screen. What am I missing?Code:#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string line;
ifstream openfile;
openfile.open("Program.txt");
if (openfile.is_open())
{
while (!openfile.eof())
{
getline (openfile,line);
cout<<line<<endl;
}
openfile.close();
}
else cout << "unable to open file";
cin.get();
}