title: What is the full "for" loop syntax in C?
body: <p>I have seen some very weird <code>for</code> loops when reading other people's code. I have been trying to search for a full syntax explanation for the <code>for</code> loop in C but it is very hard because the word "for" appears in unrelated sentences making the search almost impossible to Google effectively.</p>
  
  <p>This question came to my mind after reading <a href="https://stackoverflow.com/questions/260511/russian-peasant-multiplication">this thread</a> which made me curious again.</p>
  
  <p>The <code>for</code> here: </p>
  
  <pre><code>for(p=0;p+=(a&amp;1)*b,a!=1;a&gt;&gt;=1,b&lt;&lt;=1);
  </code></pre>
  
  <p>In the middle condition there is a comma separating the two pieces of code, what does this comma do? The comma on the right side I understand as it makes both <code>a&gt;&gt;=1</code> and <code>b&lt;&lt;=1</code>. </p>
  
  <p>But within a loop exit condition, what happens? Does it exit when <code>p==0</code>, when <code>a==1</code> or when both happen?</p>
  
  <p>It would be great if anyone could help me understand this and maybe point me in the direction of a full <code>for</code> loop syntax description.</p>