C++ Primer 5th string exercise