Why does this code work, and what is the name of what is happening?
<p>I saw the following code some time ago and nobody could answer me what was, neither knew about it.
I am using Visual Studio 2010, as C++, in a file saved as cpp (at a project of win32 cmd program), then i declare the following:</p>

<pre><code>class People {
private:
    string name;
    short age;
public:
    People (string name,short age) 
        : name(name),
          age(age) 
    {
        //
    }
    inline string getName(void) {return name;}
};

class Professor : public People {
private:
    int salary;
    int nAlunos;
public:
    Professor(string name, short age, int salary, int nAlunos) 
        : People(name,age),
          salary(salary),
          nAlunos(nAlunos) 
    {
       //
    }
};
</code></pre>

<p>Why does this assignment of the values work?</p>

<p>Notice that I don't write explicitly: <code>name = newName</code>, the stuff works on its own.</p>

<p>I also tried at wxDev-CPP and worked.</p>
