What additional cint sources do I need to compile for file IO support?
If I try to run a little example:
// reading a text file
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main () {
string line;
ifstream myfile ("example.txt");
if (myfile.is_open()) {
while (! myfile.eof()) {
getline (myfile,line);
cout << line << endl;
}
myfile.close();
}
else cout << "Unable to open file";
return 0;
}
It stops with this error message:
C:\Users\Lis\Documents\work\cint_learn>cint.exe -IC:\cint\inc
-IC:\cint\include
-IC:\cint\stl fileRead.cxx
Error: Function getline(myfile,line) is not defined in current scope
fileRead.c
xx(14)
!!! return from main() function
How to solve this?
Thanks and Greets Louis.