I need to compare two strings, one of which uses "?" wildcard. 
If the pattern is e?lo and string is hello, the comparison function should return true.
I was thinking of using a recursive method, but it apparently only works when the matching is cover the entire input string. What is the correct solution?
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#define MAX 100
bool WildCmp(char *pattern, char *string);
int main(void)
{
  char pattern[MAX];
  char string[MAX];
  printf("What is the pattern?\n");
  fgets(pattern, MAX, stdin);
  printf("What is the string?\n");
  fgets(string, MAX, stdin);
  if(WildCmp(pattern, string))
    printf("Match Found\n");
  else
    printf("Match Not Found");
  return 0;
}
bool WildCmp(char *pattern, char *string)
{
  if (*pattern=='\0' && *string=='\0')
    return true;
  if (*pattern != '\0' && *pattern != *string)
    return WildCmp(pattern, string+1);
  if (*pattern=='?' || *pattern==*string)
    return WildCmp(pattern+1,string+1);
  if (*pattern=='*')
    return WildCmp(pattern+1,string) || WildCmp(pattern,string+1);
  return false;
}
