You can use std::strchr .
If you have a C string:
const char *s = "hello, weird + char."; strchr(s, '+');
If you have an instance of std::string :
std::string s = "hello, weird + char."; strchr(s.c_str(), '+');
With std::string you can also find the search method you are looking for.
source share