title: C Programming: EOF as a character
body: <p>When programming C for the command console, what happens when you have a function that tries to use SCANF to ask user input for a CHAR variable, and the user types <strong><kbd>CTRL</kbd>+<kbd>Z</kbd></strong> (EOF) and hits enter?</p>
  
  <p>For example:</p>
  
  <pre><code>char promptChar()
  {
      char c;
      printf("Enter a character: ");
      scanf("%c", &amp;c);
      return c;
  }
  </code></pre>
  
  <p>If the user types <strong><kbd>CTRL</kbd>+<kbd>Z</kbd></strong> and hits enter, what will promptChar() return?  Because if I understand EOF, it's an int.</p>