title: C Idioms and little known facts
body: <p>Okay, I've seen many posts here about odd idioms and common practices in C that might not be initially intuitive. Perhaps a few examples are in order</p>
  
  <p>Elements in an array:</p>
  
  <pre><code>#define ELEMENTS(x) (sizeof (x) / sizeof (*(x)))
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/381542/in-c-arrays-why-is-this-true-a5-5a">Odd array indexing:</a></p>
  
  <pre><code>a[5] = 5[a]
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/154136/why-are-there-sometimes-meaningless-do-while-and-if-else-statements-in-c-c-macr">Single line if/else/while/for safe #defines</a></p>
  
  <pre><code>#define FOO(X) do { f(X); g(X); } while (0)
  #define FOO(X) if (1) { f(X); g(X); } else
  </code></pre>
  
  <p>My question to the expert C programmers out there is: What <strong>idioms</strong>, <strong>practices</strong>, <strong>code snippits</strong>, or <strong>little known facts</strong> show up a lot in C code but might not be very intuitive but offer a good insight into C programming?</p>