I am coding for the problem in which we got to count the number of common characters in two strings. Main part of the count goes like this
for(i=0; i < st
for (std::vector::iterator i = s1.begin(); i != s1.end(); ++i) { if (std::find(s2.begin(), s2.end(), *i) != s2.end()) { dest.push_back(*i); } }
taken from here