Pass a vector of pointers to function in c++ : <p>I saw many posts here but none of them explains what I'm trying to do.
I have the vector <code>vector &lt;Car*&gt; carVector;</code> and I want to pass it to a function so I can read the information of the objects in there.
The objective is to pass it and then I can use it in this cicle</p>

<pre><code>for (i = 0; i &lt; racetrack.size(); i++) {
    for (int j = 1; j &lt; nRaceTracks + 1; j++) {
        if (racetrack[i]-&gt;getNome() == info[j]) {
            size= racetrack[i]-&gt;getTrackSize() / 100;
            for (int c = 0; c &lt; carVector.size(); c++)
                carVector[c]-&gt;chargeBattery(500);
        }
    }
}
</code></pre>
