These are needed to change the default behavior of what happens when an instance is copied to another instance. By default, each member of the class or struct are copied one by one from one instance to another. For instance, assume you have two instances of class Person called p1 and p2. The class has two fiels, FirstName and LastName. When you say:
p1 = p2;
then the FirstName and LastName fields from p2 are copied to p1.
That's the default behavior.
Now, if you want to change that default behavior, then you specify a custom copy constructor and an assignment operator for the class Person to do something other than member-wise copy.
You need *both* the copy constructor and assignment operator.
The copy constructor is invoked when the copy is made at the time that the new instance is constructed, as in:
Person p2 = p1;
The assignment operator is invoked if the copy is done after p2 is already constructed, as in:
p2 = p1;
Hope this helps.