title: C++ syntax for dereferencing class member variables
body: <p>This is more of a question of syntactic elegance, but I'm learning C++ and playing around with pointers. If I have a class, Car, I can create a pointer to a new instance of that class with</p>
  
  <pre><code>Car * Audi = new Car;
  </code></pre>
  
  <p>If that class has a member variable weight (an unsigned int, say), I can access it with either</p>
  
  <pre><code>(*Audi).weight
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Audi-&gt;weight
  </code></pre>
  
  <p>If that class has a member variable age that is itself a pointer, I can access it with either</p>
  
  <pre><code>*((*Audi).age)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>*(Audi-&gt;age)
  </code></pre>
  
  <p>Is there any other way than either of these two (admittedly not particularly complicated) ways of dereferencing the pointer? I wanted to think</p>
  
  <pre><code>Audi-&gt;*age
  </code></pre>
  
  <p>would work, but alas it does not.</p>
  
  <p>(I appreciate that accessors are usually preferable, I'm just interested.)</p>