One way is to use std::string and std::vector with the 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"; }
taocp source share