title: Compare strings with wildcard
body: <p>In C, how exactly can I compare a string that contains <code>*</code> (that can be any combination of characters) with a two dimensional matrix of strings?</p>
  
  <p>For example, I have the word <code>go*s</code>. It can generate the words "gorgeous" (<code>*</code> is "orgeou"), "goodness", "goats", "goes" etc. I am supposed to read the words from a whole dictionary and compare them with a word that contains one or more asterisks (<code>*</code>). Each word that can be generated from the word with the asterisk will have to be printed. If the two words have the same length then it is easy to compare because the <code>*</code> can only be one letter.</p>
  
  <pre><code>int fq(char *s1, char *s2){
  int i, a=0, b=0, s=0;
  while (1){
      if (s1[a]=='\0')
          break;
      a++;
  }
  if (strlen(s1)==strlen(s2)){
      for(i=0; i&lt;a; i++){
          if (s1[i]=='*'){
              b++;
              }
          if (s1[i]==s2[i]){
              b++;
              }
          }
      }
  if (b==a)
      return 1;
  </code></pre>