title: Cleaner pointer arithmetic syntax for manipulation with byte offsets
body: <p>In the following lines of code, I need to adjust the pointer <code>pm</code> by an offset in bytes in one of its fields. Is there an better/easier way to do this, than incessantly casting back and forth from <code>char *</code> and <code>PartitionMap *</code> such that the pointer arithmetic still works out?</p>
  
  <pre><code>PartitionMap *pm(reinterpret_cast&lt;PartitionMap *&gt;(partitionMaps));
  for ( ; index &gt; 0 ; --index)
  {
      pm = (PartitionMap *)(((char *)pm) + pm-&gt;partitionMapLength);
  }
  return pm;
  </code></pre>
  
  <p>For those that can't grok from the code, it's looping through variable length descriptors in a buffer that inherit from <code>PartitionMap</code>.</p>
  
  <p>Also for those concerned, partitionMapLength always returns lengths that are supported by the system this runs on. The data I'm traversing conforms to the <a href="http://en.wikipedia.org/wiki/Universal_Disk_Format" rel="nofollow noreferrer">UDF</a> specification.</p>