I have been trying to figure out how to write a copy constructor, but whenever I run it it doesn't compile. Logically, I feel like what I'm doing makes sense, but apparently my compiler doesn't seem to think so.
This is my AddTail function, which is used in my copy constructor.
for (unsigned int i = 0; i < list.numNodes; i++)
{
AddTail(currentNode->data);
currentNode = currentNode->next;
}
}]
I've also tried using a while loop instead of the for loop, but that doesn't seem to make much of a difference. My addTail function seems to work, so I don't think the issue is there.