title: strstr to find a word in a string using c returning true all the time
body: <p>Good Day,</p>
  
  <p>So I decided to go trough my C again and started making a simple search the word in a string.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  #include&lt;string.h&gt;
  
  main(){
  char word[100];
  char sentence[100];
  
  clrscr();
  printf("Enter a word: ");
  fgets(word, 100, stdin);
  getch();
  printf("The word is : %s", &amp;word);
  getch();
  printf("\nEnter a sentence: ");
  fgets(sentence, 100, stdin);
  getch();
  printf("The sentence is: %s",&amp;sentence);
  getch();
  if(strstr(sentence,word) == 0){
    printf("word found!");
  }
  getch();
  return 0;
  }
  </code></pre>
  
  <p>The problem now is that whenever i try to search for the word in a string using <code>strstr</code>, it always returns <strong>word found</strong>. I also tried using <code>strcmp</code> but that will only compare the first instance of the string and stops when a match is not found so its not really advisable if you want to do a word searching in a string problem.</p>
  
  <p>I haven't really made a program like this before, never needed one actually. So may I ask why is not working properly since according to its description <code>strstr</code> should be to search for a word in a sentence or did I just misunderstood it.</p>
  
  <p>Also if you have any comments on my program feel free to say so, so that I may become aware of my mistake.</p>
  
  <p>Thank you</p>
  
  <p><strong>Example:
  word: dog <br/>
  sentence: the dog is here <br/>
  should return true</strong></p>