strstr in string in c++ code example
Example: c++ recorrer string
std::string s = "Hola-perro-Cosa";
int init = 0;
int end = 0;
while( end = s.find("-", init), end >= 0 )
{
std::cout << s.substr(init, end - init) << '\n';
init = end + 1;
}
std::cout << s.substr(init);