Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. int count(const char *s, const char *m) {
  2. int found = 0;
  3. while (*s != '\0') {
  4. if (*s == *m) {
  5.  
  6. const char *s2 = s;
  7. const char *m2 = m;
  8. bool f = true;
  9.  
  10. while (*m2 != '\0') {
  11. if (*s2 != *m2) {
  12. f = false;
  13. break;
  14. }
  15. s2++;
  16. m2++;
  17. }
  18.  
  19. if (f)
  20. found++;
  21. }
  22. s++;
  23. }
  24. return found;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement