title: Is 'If Else' statement indentation important or not in C++?
body: <p>Does the indentation in an <em>if else</em> statement have any bearing on the execution of the code or is it just something to do for cleaner code?</p>
  <p>Example from the book <em><a href="https://en.wikipedia.org/wiki/Andrew_Koenig_(programmer)#Books" rel="nofollow noreferrer">Accelerated C++</a></em> written by <a href="https://en.wikipedia.org/wiki/Andrew_Koenig_(programmer)" rel="nofollow noreferrer">Andrew Koening</a>:</p>
  <pre><code>while(c != cols) {
      if(r == pad + 1 &amp;&amp; c == pad + 1) {
        cout &lt;&lt; greet;
        c += greet.size();
  
      } else {
  
        if(r == 0 || r == rows - 1 || c == 0 || c == cols - 1)
          cout &lt;&lt; &quot;*&quot;;
  
        else
          cout &lt;&lt; &quot; &quot;;
          ++c;
      }
    }
  </code></pre>
  <p>The prefix increment of <code>c</code> is executed regardless of whether r=0 or not, but I don’t understand why.</p>
  <p>If the <em>if</em> statement turns true, an asterisk is printed. <em>If</em> not, a blank space is printed and <code>c</code> is incremented.
  That’s how I am reading it, but <code>c</code> gets incremented regardless of what the values of <code>r</code> or <code>c</code> are.</p>
  <p>This is what it says in the book, but there isn’t any explanation I could find:</p>
  <blockquote>
  <p>Notice how the different indentation of
  ++c;
  draws attention to the fact that it is executed regardless of whether we are in the
  border.</p>
  </blockquote>