title: Effect of using a comma instead of a semi-colon in C and C++
body: <p>I've noticed on a number of occasions when refactoring various pieces of C and C++ code that a comma is used rather than a semi-colon to seperate statements.  Something like this;</p>
  
  <pre><code>int a = 0, b = 0;
  a = 5, b = 5;
  </code></pre>
  
  <p>Where I would have expected </p>
  
  <pre><code>int a = 0, b = 0;
  a = 5; b = 5;
  </code></pre>
  
  <p>I know that C and C++ allow use of commas to seperate statements (notably loop headers), but what is the difference if any between these two pieces of code?  My guess is that the comma has been left in as the result of cut &amp; pasting, but is it a bug and does it effect execution?</p>