title: Using character for sentinel but receiving pointer error
body: <p>I'm trying to program a loop that counts characters until it receives a certain sentinel value. The sentinel value is supposed to be a #, but I've also tried a 0 and a Z and had the same response.</p>
  
  <p>When it compiles, I receive "warning: comparison between pointer and integer" for lines 16 (the line that calls the sentinel.) </p>
  
  <p>If I don't define the sentinel, but instead rely on logical operators in the while statement, then I receive no error, but have an endless loop.</p>
  
  <p>Thanks!</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
  
  #define SENTINEL '#'
  char ch;
  int chcount;
  
  printf("Enter your text, terminate with a #:");
  scanf("%s", &amp;ch);
  chcount = 0;
  
  while (ch != SENTINEL)
  {
      if ((ch &gt;= 'A') &amp;&amp; (ch &lt;= 'Z'))
      {
          chcount = chcount +1;
          printf("You have entered %d characters", chcount);
      }
  }
  return(0)
  }
  </code></pre>