no member named line in std
Hi , I'm trying to write on file but here is a problem : where there is get line(input.line)) , Xcode return me an error : no member named 'line' in std::_1::basic_ifstream<char,std::_1::char_traits<char>>'. Can you help me ? Thanks
#include <iostream>
#include <fstream>
#include <string>
usingnamespacestd;
using std::ofstream;
using std::ifstream;
using std::string;
int main()
{
string line ;
cout<<" Cosa vorresti scrivere sul file ? "<<endl;
ofstream output;
output.open("myfile.txt");
while( line != "exit"){
output<<line<<endl;
cin>>line;
}
output.close();
cout<<"Ho scritto sul file !"<<endl<<endl;
cout<<"Contenuto file:"<<endl;
ifstream input;
input.open("myfile.txt");
while (getline(input.line)){
cout<<line<<endl;
}
input.close();
return 0;
}
MacBook Pro with Retina display, macOS Mojave (10.14), Nvidia 750M + 16 GB of Ram