Unintentionally copying argument
<p>I'm trying to create an <code>AddItem</code> and <code>DeleteItem</code> function for my <code>array&lt;Email, MAX_SIZE&gt;</code>, called <code>ulist</code>.</p>

<p>The problem is, it's creating a local copy of the variable and adding that instead.</p>

<p>I'm new to pointers so it's probably a really simple mistake but it's been frustrating me for about an hour now.</p>

<p>Here is the code:</p>

<pre><code>void UnsortedList::AddItem(Email &amp;item)
{
    cout &lt;&lt; "Going to add " &lt;&lt; &amp;item &lt;&lt; endl;

    list[Length] = item;

    cout &lt;&lt; "Added " &lt;&lt; &amp;list[Length] &lt;&lt; endl;
    Length++;
}
</code></pre>

<p>From the driver:</p>

<pre><code>Email e1("sender", "content");
UnsortedList ulist;
ulist.Add(e1);
</code></pre>

<p>Output:</p>

<pre><code>Going to add 0018F6FC
Added 0018D09C
</code></pre>