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