Read text file line by line.... c++
-
Hi, I want to read Text File line by line and code follows;(with out using the << operator and char buffer) ifstream Textfile; Textfile.open(strFilePath,ios::in); string value; while(!Textfile.eof()) { getline(Textfile,value); } Textfile.close(); When i am compiling the above code it throws the error as error C3861: 'getline': identifier not found, even with argument-dependent lookup How to rectify this error.. reg, Subbu
-
Hi, I want to read Text File line by line and code follows;(with out using the << operator and char buffer) ifstream Textfile; Textfile.open(strFilePath,ios::in); string value; while(!Textfile.eof()) { getline(Textfile,value); } Textfile.close(); When i am compiling the above code it throws the error as error C3861: 'getline': identifier not found, even with argument-dependent lookup How to rectify this error.. reg, Subbu
Hi, aren't you confusing standard C/C++ (see C/C++/MFC forum) with managed C++/CLI (this forum), where string class and File.ReadAllLines() would be useful (and getline is unheard of)? :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
Hi, I want to read Text File line by line and code follows;(with out using the << operator and char buffer) ifstream Textfile; Textfile.open(strFilePath,ios::in); string value; while(!Textfile.eof()) { getline(Textfile,value); } Textfile.close(); When i am compiling the above code it throws the error as error C3861: 'getline': identifier not found, even with argument-dependent lookup How to rectify this error.. reg, Subbu
If I'm not mistaken, geline() is a method - you need to call it on a basic_istream object. Maybe Textfile.getline(Textfile,value);
Mark Salsbery Microsoft MVP - Visual C++ :java: