C++ private members accessible?
<p>I have this project in our signals class which uses C++. I was tinkering with our instructors code when I saw this:</p>

<pre><code>ListData::ListData(const ListData&amp; newlist) 
    : Data(), nbNodes(newlist.nbNodes) {}
</code></pre>

<p>This is a "copy constructor" as he says, and should be roughly equivalent to the following:</p>

<pre><code>ListData::ListData(const ListData&amp; newlist){
  Data = "";
  //copy nbNodes of newList to current instance
  nbNodes = newlist.nbNodes;
}
</code></pre>

<p>But what bothers me is that <code>nbNodes</code> is a private member. <strong>How could this constructor access the <code>nbNodes</code> of the passed <code>newList</code> if it's private?</strong></p>
