First, your assignment operation should return a reference to yourself. It should not be const either, since you are assigning to yourself. See many references, mainly Scott Meyers "Effective C++", for reasoning.
Since you are just learning, and I don't see it in there, I assume you are not supposed to know about move semantics, so I'll leave that out...
Assignment operator from another rectangle...
rectangleType &
rectangleType::
operator=(rectangleType const & that)
{
length = that.length;
width = that.width;
return *this;
}
However, it looks like the default assignment operator would be sufficient. If you are required to write the assignment operator for class, I imagine you also have to write the copy constructor as well.
If you are going to have an operator-
you should also have operator-=
. Again, consult Meyers for lots of explanation.
On your subtraction implementation... Egads. Really? cout for an error? and then return an object that is not the right answer?