title: Mixed indexing behaviour for typedef array?
body: <p>I have a typedef:</p>
  
  <pre><code>typedef unsigned char MyType[2];
  </code></pre>
  
  <p>I pass it to a function and the result is FAIL! </p>
  
  <pre><code>void f(MyType * m)
  {
  *m[0] = 0x55;
  *m[1] = 0x66;
  }
  
  void main(void)
  {
  Mytype a;
  a[0] = 0x45;
  a[1] = 0x89;
  
  f(&amp;a);
  }
  </code></pre>
  
  <p>The manipulation of variable <code>a</code> in <code>main()</code> works on 1 byte indexing, so <code>a</code> is equal to {0x45, 0x89}. However in function <code>f</code> the indexing acts on 2 bytes (the <code>sizeof</code> the type).</p>
  
  <p>So in function <code>f</code>, <code>*m[1]</code> in this instance is actually modifying memory out of bounds. </p>
  
  <p>Why is this, what have I forgotten?</p>
  
  <p>Thanks.</p>