title: Accessing a data member of a pointer
body: <pre><code>class Cat
  {
    public:
      int name;
      Cat();
      int getName();
  }
  </code></pre>
  
  <p>if I have a:</p>
  
  <pre><code>Cat* pointer = new Cat();
  pointer-&gt;getName();
  pointer-&gt;name; //this doesn't work
  </code></pre>
  
  <p>so how can I access the data member: name?</p>