Error 1 error C3861: \'getline\':identifier not found c:\\users\\alex\\documents
ID: 3617961 • Letter: E
Question
Error 1 error C3861: 'getline':identifier not found c:userslexdocumentsisual studio2008projectscoplexch12_5.cpp 18Error 2 error C2679: binary'<<' : no operator found which takes a right-hand operand oftype 'std::string' (or there is no acceptableconversion) c:userslexdocumentsisual studio2008projectscoplexch12_5.cpp 21
Error 3 error C3861: 'getline':identifier not found c:userslexdocumentsisual studio2008projectscoplexch12_5.cpp 24
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main()
{ ifstream in;
char filename[80];
string input;
int line=0;
cout<<"what is the name of the file you areusing? ";
cin>>filename;
in.open(filename);
if(in.fail())
{ cout<<"file did notopen please check it ";
system("pause");
return 1;
}
getline(in,input); ERROR HERE
while (in)
{ line++;
cout<<setw(3)<<line<<":"<<input<<endl; ERROR HERE
if(line%24==0)
system("pause");
getline(in,input); ERROR HERE
}
in.close();
system("pause");
return 0;
}
Explanation / Answer
please rate - thanks I'm using Dev C++ and get no errors, I believe you have to includestring #include #include #include #include using namespace std; int main() { ifstream in; char filename[80]; string input; int line=0; coutfilename; in.open(filename); if(in.fail()) { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.