title: Trouble with strchr in C
body: <p>I can't work out why <code>Strchr()</code> is not working in my function. I need to see if the users guess matches any of the letters in a hidden word. It is a Hangman game.</p>
  
  <pre><code>int guessLetter(char* word, int* guessedLetters)
  {
      char guess[20];
      char *s;
  
      printf("Enter your guess: ");
      scanf("%s", &amp;guess);
  
      s = strchr (word, guess);
      printf("%s", s);
  
      if (s != NULL) {
          printf ("Good Guess\n");
      } else {
          printf ("Bad Guess\n");
      }
  
  }
  </code></pre>
  
  <p>No matter if the guess is right or wrong, my <code>else</code> statement is being activated. My <code>printf</code> shows that <code>s</code> is being given the value of <code>Null</code> no matter if the character is in the word or not.</p>
  
  <p>So I guess my problem is with this part of the code:</p>
  
  <pre><code>s = strchr (word, guess);
  </code></pre>
  
  <p>I am new to C, so I am sure I am just missing something very basic. I have tried to search the web as much as I can, but I don't really seem to be able to understand what I am doing wrong.</p>