Implementing my own version of c++ string class