Is there any simple method to search whether a particular stringis present in a vector<string> v1?
Printable View
Is there any simple method to search whether a particular stringis present in a vector<string> v1?
Also how to get index number?
i.e. I want to know at what location string "phone" is stored in vector<string> v1.
How I will get that?
Please help.
Yes. Look at the functions in the <algorithm> header.
Is there any such function available?
Look at this dictionary definition, and you will realise CornedBee has answered your question.
Algorithm (n) : A finite set of unambiguous instructions performed in a prescribed sequence to achieve a goal, especially a mathematical rule or procedure used to compute a desired result. Algorithms are the basis for most computer programming.
Thanks A Lot.