you should have two version one const and the other normal one.
int length()const ;
What does this get you that you don't already have with int length() const; ? The const lets you use length() when you have a const reference to an instance of your class, but it doesn't prevent anything when you don't. Or am I missing something?