Problem with passing vector of pointers to objects to member function of another object
<p>I have a vector of pointers to Mouse objects called 'mice'.
I'm passing the mice to the cat by reference.</p>

<pre><code>vector &lt;Mouse*&gt; mice;
Cat * c;

c-&gt;lookForMouse(&amp;mice);
</code></pre>

<p>And here's my lookForMouse() member function</p>

<pre><code>void Cat::lookForMouse(vector &lt;Mouse*&gt; *mice)
{
  ...
}
</code></pre>

<p>And now to the problem!  Within the function above, I can't seem to access my mice.  This below will not work</p>

<pre><code>mice[i]-&gt;isActive();
</code></pre>

<p>The error message I receive suggests to use mice[i].isActive(), but this throws an error saying isActive() is not a member of std::vector&lt;_Ty> ...</p>

<p>This works though...</p>

<pre><code>vector &lt;Mouse*&gt; miceCopy = *mice;
miceCopy[i]-&gt;isActive();
</code></pre>

<p>I understand that I shouldn't be creating another vector of mice here, it defeats the whole point of passing it by reference  (let me know if I'm wrong)...</p>

<p>Why can't I do mice[i]->isActive() What should I be doing?</p>

<p>Thanks for your time and help :D</p>

<p>James.</p>
