title: Indexing an integer
body: <p>i'm fairly new to programming, so have mercy on my unknowing soul ;)</p>
  
  <p>I've found following code, which i don't really understand:</p>
  
  <pre><code>void main(void)
  {
     char a[]="0123456";
     int i=5;
  
     printf("%c\n", a[i]);
     printf("%c\n", i[a]);
  }
  </code></pre>
  
  <p>Now my question: why does the last line even work? Indexing and integer should, as far as i know, not even work? I guess it has something to do with the output being set to char.</p>
  
  <p>Could somebody please explain this to me?</p>
  
  <p>Thanks,
  redscale</p>