new object in c++
<p>i'm new to c++ programming and i will be happy if you can help me.
i tried to write this code:</p>

<pre><code>bool RailwayLineList:: AddInTail(const RailwayLine&amp; data)
{
    //there is no linked list to add the element
    if(this==NULL)
        return false;
    RailwayLineLink *newLink =  new RailwayLineLink(data);
}
</code></pre>

<p>when i tried to debug it i saw that the copy constructor had been called and the data had been initialized with some garbage (the class is using a default constructor).</p>

<p>why is the copy constructor being called?</p>
