title: Is it safe and portable to cast pointer to any type to char pointer for arithmetic?
body: <p>Considering the following snippet, and for both C and C++ languages, is:</p>
  <pre><code>int t[2] = { 0, 1 };
  *( (int *)( (char *)t + sizeof(int) ) ) = 2;
  </code></pre>
  <p>always equivalent to:</p>
  <pre><code>int t[2] = { 0, 1 };
  t[1] = 2;
  </code></pre>
  <p>?</p>
  <p>It might sound weird but I imagined some reasons why it could be false on some platforms:</p>
  <ol>
  <li><p><code>char</code> pointer increment could go in a reverse way than <code>int</code> pointer, unless it is not authorized by  the standard (in this case I would like to find where the standards states so)</p>
  </li>
  <li><p>the cast from <code>int *</code> to <code>char *</code> could be unsafe because there is not guaranty that their size are the same (and in this case, could it work with an intermediate cast to <code>void *</code>?), and because the standard does not guaranty that casting to <code>char *</code> and then to a pointer to any type is safe</p>
  </li>
  </ol>