Guest User

Untitled

a guest
Jan 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. int     match(char *s1, char *s2)
  2. {
  3.   printf("s1:%c s2:%c\n", *s1, *s2);
  4.   if (*s1 == 0 && *s2 == 0)
  5.     return (1);
  6.   if (*s1 != *s2 && *s2 != '*')
  7.     return (0);
  8.  
  9.   if (*s1 == s2[1])
  10.     return (match(s1, ++s2));
  11.   if (*s1 == *s2)
  12.     return (match(++s1, ++s2));
  13.   if (*s2 == '*' && *s1 != 0)
  14.     return (match(++s1, s2));
  15.   return (0);
  16. }
Add Comment
Please, Sign In to add comment