So, I have a problem with my ifstream, it would seem: even though the file path
is legit, ifstream throws a failbit. Does anyone have a clue what may be the problem, or ideas on general I/O newbie pitfalls? It would be much appreciated!
1 2 3 4 5 6 7 8 9 10 11
ifstream input("C:\text.txt");
string line;
if (input.fail())
cout << "Fail!";
else {
while (getline(input,line))
cout << line;
}