0

Pleas give me an easier method to search from a text file or a list file .

Pleas give me an easier method to search from a text file or a list file .

10th Aug 2018, 12:38 PM
Kainat Rasheed
Kainat Rasheed - avatar
5 Respuestas
+ 1
Kainat Rasheed , do something like below: ifstream input; size_t pos; string line; input.open("t.txt"); if(input.is_open()) { while(getline(input,line)) { pos = line.find("hey"); if(pos!=string::npos) { cout <<"Found!"; break; } } }
10th Aug 2018, 1:12 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
happy to help
10th Aug 2018, 1:15 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
+ 1
there ways to search... refer below article & few next of these articles for search...: https://www.sololearn.com/learn/661/?ref=app
10th Aug 2018, 1:18 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
Ketan Lalcheta thanks ;)
10th Aug 2018, 1:14 PM
Kainat Rasheed
Kainat Rasheed - avatar
0
Ketan Lalcheta can you please guife me more ... that which topic should i study for this searching
10th Aug 2018, 1:15 PM
Kainat Rasheed
Kainat Rasheed - avatar