Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int match(char *s1, char *s2)
- {
- printf("s1:%c s2:%c\n", *s1, *s2);
- if (*s1 == 0 && *s2 == 0)
- return (1);
- if (*s1 != *s2 && *s2 != '*')
- return (0);
- if (*s1 == s2[1])
- return (match(s1, ++s2));
- if (*s1 == *s2)
- return (match(++s1, ++s2));
- if (*s2 == '*' && *s1 != 0)
- return (match(++s1, s2));
- return (0);
- }
Add Comment
Please, Sign In to add comment