I'm trying to read a simple file, which contains only two lines, but the program only shows one. The program:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
string str;
ifstream myfile;
myfile.open("file.lua");
myfile >> str;
cout << str << endl;
myfile.close();
return 1;
}
The result is:
print (1)
Process returned 1 (0x1) execution time: 0.044 s Press any key to continue.
The file contains:
print (1) print ("Hello")