title: Expression must be a modifiable lvalue
body: <p>I have this following code:</p>
  
  <pre><code>int M = 3; 
  int C = 5; 
  int match = 3;
  for ( int k =0; k &lt; C; k ++ )
  {
      match --; 
      if ( match == 0 &amp;&amp; k = M )
      {
           std::cout &lt;&lt; " equals" &lt;&lt; std::endl;
      }
  }
  </code></pre>
  
  <p>But it gives out an error saying:</p>
  
  <blockquote>
    <p>Error: expression must be a modifiable value</p>
  </blockquote>
  
  <p>on that "if" line. I am not trying to modify "match" or "k" value here, but why this error? if I only write it like:</p>
  
  <pre><code>if ( match == 0 )
  </code></pre>
  
  <p>it is ok. Could someone explain it to me? </p>