title: Do if(){ } while() statement
body: <p>I am currently working on somebody's else code, with a statement like this</p>
  
  <pre><code>if(x.start()) do if(y.foo(x)) {
  
  // Do things
  
  }while(x.inc())
  </code></pre>
  
  <p>here <code>x</code> is custom class that holds information on <code>y</code> and allows iteration through its element in a special order. I put this info if relevant, but my question is more general:</p>
  
  <p>I thought that in a  <code>do{}while()</code> statement the <code>do</code> part had to be followed by the bracket, and this togheter with the <code>while()</code> condition at the end defines the do-while loop.</p>
  
  <ul>
  <li>Why can we put an <code>if</code> right after the <code>do</code>? </li>
  <li>What does it do?</li>
  <li>What else can be put in between <code>do</code> and <code>{</code>?</li>
  </ul>
  
  <p>I couldn't find other questions relating to this or on google, most stuff related to putting <code>if</code> statements inside <code>while loop</code>. </p>