title: strstr() function
body: <p>I am trying to write a program that compares a substring that the user enters with an array of strings.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  char animals[][20] = {
      "dogs are cool",
      "frogs are freaky",
      "monkeys are crazy"
  };
  
  int main() {
      char input[10];
  
      puts("Enter animal name: ");
      fgets(input, sizeof(input), stdin);
  
      int i;
      for(i = 0; i &lt; 3; i++) {
          if(strstr(animals[i], input))
              printf("%s", animals[i]);
      }
      return 0;
  }
  </code></pre>
  
  <p>When I enter frogs, for example it should print the message "frogs are freaky", but it prints out nothing. </p>
  
  <p>So I tried to write a line to print out the value of the strstr() function each time and they all returned 0, which means all the comparisons failed. I don't understand why, can someone help me please?</p>