Checking if array contains char
arrays, c++, char, contains
Solution
One way do it is to use `std::string` and `std::vector` with `std::find` algorithm:
std::vector<std::string> strs{"hello","wooorld","hi"};
std::string toFind = "abcd";
if (std::find(strs.begin(), strs.end(), toFind) != strs.end())
{
std::cout <<" abcd exist in vector of strings";
}
Problem
Ok, this is what I have been trying to do, please correct me if I am wrong I am trying to check if myarray contains the char abcd. What I am thinking of doing it this way: ``` char* myarray[] = { "hello", "wooorld", "hi"}; if(myarray->Contains(abcd)) { //do stuff } ``` My question is, is there a better way of doing it?