title: what is EOF key in C++
body: <p>I am using Windows 7 Ultimate. I am new to C++. Following is my exercise for switch statement.</p>
  
  <pre><code>void GradeBook::inputGrades()
  {
      int grade;
  
      cout &lt;&lt; "Enter Grade: " &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 ' ':
             case '\t':
                 break;
  
              default:
                  cout &lt;&lt; "Incorrect data. Re Enter" &lt;&lt; endl;
                  break;
          }
  
      }
  }
  </code></pre>
  
  <p>I run this inside netbeans, and I pressed all the combinations ctrl+c , ctrl+z, ctrl+d but it is not ending!! Why is that? Have I done something wrong? Please help!!</p>