title: comparing getchar with a character returns a warning and gives me the wrong code
body: <p>i'm having a problem with comparisons using getchar() and file redirection.</p>
  
  <p>I have a code that resembles this:</p>
  
  <pre><code>char result = getchar(); // getchar returns the next char in the file
  int linecount = 0;
  
  if (result == "\n") {
      linecount++;
  }
  </code></pre>
  
  <p>But I get a warning when compiling it. It says that I can't compare an int with a pointer, but from my understanding, result is a char and so is "\n", so I'm really confused. I can also use printf("%c", result") and it works fine, implying that result is a char. Does anyone know why I'm getting this error? Thanks! Also, running the code, linecount will always return 0 even if the first character in the file I'm using as my input is a newline.</p>