title: How to put EOF(end of file ) in code::blocks?
body: <pre><code>#include &lt;iostream&gt;
  
  using std::cout;
  using std::cin;
  using std::endl;
  
  int main()
  {
      int grade,
          aCount = 0,
          bCount = 0,
          cCount = 0,
          dCount = 0,
          fCount = 0;
  
      cout &lt;&lt; "Enter the letter grades." &lt;&lt; endl
          &lt;&lt; "Enter the EOF character to end input." &lt;&lt; endl;
  
      while ( ( grade = cin.get() ) != EOF ) {
  
          switch ( grade ) {
  
              case 'A':
              case 'a':
                  ++aCount;
                  break;
  
              case 'B':
              case 'b':
                  ++bCount;
                  break;
  
              case 'C':
              case 'c':
                  ++cCount;
                  break;
  
              case 'D':
              case 'd':
                  ++dCount;
                  break;
  
              case 'F':
              case 'f':
                  ++fCount;
                  break;
  
              case '\n':
              case '\t':
              case ' ':
                  break;
  
                      default:
                          cout &lt;&lt; "Incorrect letter grade entered."
                              &lt;&lt; " Enter a new grade." &lt;&lt; endl;
                          break;
  
          }
      }    
  
      cout &lt;&lt; "\n\nTotal for each letter grade are:"
           &lt;&lt; "\nA: " &lt;&lt; aCount
           &lt;&lt; "\nB: " &lt;&lt; bCount
           &lt;&lt; "\nC: " &lt;&lt; cCount
           &lt;&lt; "\nD: " &lt;&lt; dCount
           &lt;&lt; "\nF: " &lt;&lt; fCount &lt;&lt; endl;
  
                  return 0;
  }    
  </code></pre>
  
  <p>I build and run this and it says "EOF has not been declared" at line 19 i.e. the line with the while header. I typed the exact codes one by one.</p>