title: For Loop Not Stopping
body: <p>I have a for loop in a function that won't stop.
  Here is the entire function which is used for finding a person's grades, adding them together, then displaying the average onscreen:</p>
  
  <pre><code>float Student::average() { 
     cout &lt;&lt; "How many grades would you like to enter? (Up to ten)\n";
     float x;
     cin &gt;&gt; x;
  
     cout &lt;&lt; "What is your first grade?";
     cin &gt;&gt; grade[0];
     int i = 1;
     for (i; i = x; i++) {
        cout &lt;&lt; "What is the next number?\n";
        cin &gt;&gt; grade[i];
     }
     averageGrade = std::accumulate(grade, grade+10, 0.0);
     averageGrade = averageGrade / 10;
  
     return averageGrade;
  }
  </code></pre>
  
  <p>And here is the for loop on its own:</p>
  
  <pre><code>for (i; i = x; i++) {
     cout &lt;&lt; "What is the next number?\n";
     cin &gt;&gt; grade[i];
  }
  </code></pre>
  
  <p>An error also outputs (but still allows the program to run) saying:</p>
  
  <blockquote>
    <p>1>c:\users\hastudent\documents\visual studio     2008\projects\weapons\weapons\weapon.cpp(25) : warning C4244: '=' : conversion from 'float' to 'int', possible loss of data</p>
    
    <p>1>c:\users\hastudent\documents\visual studio 2008\projects\weapons\weapons\weapon.cpp(30) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data</p>
  </blockquote>
  
  <p>The program gets up to the point where it ask for the next number. Then you input the number and it keeps asking you that forever.</p>