Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int count(const char *s, const char *m) {
- int found = 0;
- while (*s != '\0') {
- if (*s == *m) {
- const char *s2 = s;
- const char *m2 = m;
- bool f = true;
- while (*m2 != '\0') {
- if (*s2 != *m2) {
- f = false;
- break;
- }
- s2++;
- m2++;
- }
- if (f)
- found++;
- }
- s++;
- }
- return found;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement