含有通配符的字符串匹配(递归)

bool findString(char* str, char* t)
{
  if('\0' == *t)
   return 1;
  if('*' == *t)
 {
  while('\0' != *str)
  {
   if(findString(str++, t + 1))
    return 1;
  }
 }
 if('\0' == *str)
  return 0;
 if('?' == *t || *str == *t)
 {
  return findString(str + 1, t + 1);
 }
 return 0;
}

原文地址:https://www.cnblogs.com/hbf369/p/2707847.html