title: why can't i compare strings
body: <p>What the program is supposed to do:</p>
  
  <p>Gets a DNA code from the user</p>
  
  <p>Gets 10 3-letter words</p>
  
  <p>If the combination of any 2 3-letter corresponds with the DNA code program prints it.</p>
  
  <p>I hope I managed to explain it well.</p>
  
  <p>I don't know why it crashes, but I guess it is about the double pointer thing I tried to do. Or the strcmp thing.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      char * dna;
      char ** sample;
      int i,j,len;
  
      dna = (char*) malloc(sizeof(char)*20);
  
      gets(dna);
      sample = (char **) malloc(sizeof(char*)*10);
      for(i=0; i&lt;5; i++)
      {
          sample[i] = (char *) malloc(sizeof(char)*3);
      }
  
      for(i=0; i&lt;5; i++)
      {
          gets(sample[i]);
      }
  
      for(i=0; i&lt;5; i++)
      {
          for(j=0; j&lt;5; j++)
          {
              strcat(sample[i],sample[j]);
              if(strcmp(sample[i], dna)==0)
              {
                  puts(sample[i]);
                  return 0;
              }
          }
      }
  
      for(i=0;i&lt;5;i++)
      {
          free(sample[i]);
      }
  
      free(sample);
      free(dna);
      return 0;
  }
  </code></pre>