title: Why is it that I can't use == in a For loop?
body: <p>I don't know if that's been asked before, but I haven't been able to find an answer, nonetheless. My question is this; in For loops, this is acceptable.</p>
  
  <pre><code>int k = 0;
  
  for (int i = 0; i &lt;= 10; i++)
      k++;
  </code></pre>
  
  <p>But this is NOT:</p>
  
  <pre><code>int k = 0;
  
  for (int i = 0; i == 10; i++)
      k++;
  </code></pre>
  
  <p>Why is it that I cannot use '==' to determine whether the condition has been met? I mean, both expressions return true or false depending on the situation and the latter would be appropriate for, say, an If loop.</p>
  
  <pre><code>int k = 10;
  
  if (k == 10)
  {
      // Do stuff.
  }
  </code></pre>
  
  <p>The answer to this question has been bothering me for a good while now during my time as a hobbyist programmer, but I hadn't searched for it till now.</p>