Is there any simple method to search whether a particular stringis present in a vector<string> v1?
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.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
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.