STL in C++ how does it work
<p>I have very technical question, I was working with C, and now I'm studying C++,
if I have for example this class</p>

<pre><code>class Team {
private:
   list&lt;Player&gt; listOfPlayers;
public:
    void addPlayer(string firstName, string lastName, int id) {
        Player newPlayer(string firstName, string lastName, int id);
            listOfPlayers.push_back(Player(string firstName, string lastName, int id));
    }
};
</code></pre>

<p>this is a declaration of the Player:</p>

<pre><code>class Player{
private:
    string strLastName;      
    string strFirstName;     
    int nID;                
public:
    Player(string firstName, string lastName, int id);

};
</code></pre>

<p>and this is my constructor of Player:</p>

<pre><code>Player::Player(string firstName, string lastName, int id){
    nId = id;
    string strFirstName = firstName;
    string strLastName = lastName;
}
</code></pre>

<p>so my question is when I call function <code>addPlayer</code> what exactly is going on with program,</p>

<p>in my constructor of Account do I need to allocate new memory for <code>new Player</code>(cause in C I always use malloc) <code>for strFirstName and strLastName</code>, or constructor of string of Account and STL do it without me, thanks in advance (if you don't want to answer my question please at least give me some link with information) thanks in advance</p>
