Reading a .txt file in C++ [on hold]
Reading a .txt file in C++ [on hold] So im trying to write a program in C++ that takes input line by line from a text file and give it as and output but im running into errors that I cant find very good answers to. Thanks in advance for the help Code is: 1 #include "stdafx.h" 2 #include <iostream> 3 #include <fstream> 4 #include <string> 5 using namespace std; 6 int main() 7 { 8 string line; 9 ifstream file("INPUT.txt"); 10 if (file.is_open()) 11 { 12 while(getline(file,line) 13 { 14 cout << line << 'n' 15 } 16 file.close(); 17 18 } 19 else 20 { 21 cout << "file is not open" << 'n'; 22 } 23 24 return 0; 25 } The errors from the compiler read: line(15): error C2064: term does not evaluate to a fun...
