title: Comparing user-inputted characters in C
body: <p>The following code snippets are from a C program.</p>
  
  <p>The user enters Y or N.</p>
  
  <pre><code>char *answer = '\0';
  
  scanf (" %c", answer);
  
  if (*answer == ('Y' || 'y'))
      // do work
  </code></pre>
  
  <p>I can't figure out why this <code>if</code> statement doesn't evaluate to true.</p>
  
  <p>I checked for the y or n input with a <code>printf</code> and it is there, so I know I'm getting the user input. Also when I replace the the condition of the if statement with 1 (making it true), it evaluates properly.</p>