title: What's the result of += in C and C++?
body: <p>I've got the following code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(int argc, char **argv) {
      int i = 0;
      (i+=10)+=10;
      printf("i = %d\n", i);
      return 0;
  }
  </code></pre>
  
  <p>If I try to compile it as a C source using gcc I get an error:</p>
  
  <pre><code>error: lvalue required as left operand of assignment
  </code></pre>
  
  <p>But if I compile it as a C++ source using g++ I get no error and when i run the executable:</p>
  
  <pre><code>i = 20
  </code></pre>
  
  <p>Why the different behavior?</p>