Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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:userslexdocuments isual studio2008projectscoplexch12_5.cpp   18
Error   2   error C2679: binary'<<' : no operator found which takes a right-hand operand oftype 'std::string' (or there is no acceptableconversion)   c:userslexdocuments isual studio2008projectscoplexch12_5.cpp   21
Error   3   error C3861: 'getline':identifier not found   c:userslexdocuments isual 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())                  { cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote