PDA

Click to See Complete Forum and Search --> : strstr() with a string


Buy2easy.com
Feb 20th, 2003, 04:58 PM
O.K. how do you use the strstr function I just can not figure it out

or is there something else i can do

i am reading from a file line by line and sticking it in a string each time i read in a new line i want to be able to search through it for a particular string....for example:

string Str2BeRead;
string searcher = "whatever i want";

say a string is read in and put into the Str2BeRead string. How would i search it for the searcher string? thanks!

parksie
Feb 20th, 2003, 07:47 PM
Str2BeRead.find(params);See the docs on std::string::find() for more details :)