0

Why doesnt getline() work with files?

I tried #include <fstream> #include <string> ifstream Myfile("file.txt"); int temp;. //to get and store file values temporarily while(Myfile) { getline (Myfile, temp, ' , '); // to delimit CSV } How can I fix this?

22nd Apr 2018, 7:54 AM
Whiless
Whiless - avatar
1 Answer
+ 1
What exactly happened when you executed it? (Btw. the playground doesn't support file interaction as far I know)
22nd Apr 2018, 8:33 AM
Aaron Eberhardt
Aaron Eberhardt - avatar