In partialHash funciton, code[2] is out-of-boundary access when code only contains "a"
unsigned Hash::partialHash( const string & code ){
return (code[0]*26+code[1])*26+code[2];
}
you could use at() function and catch the thrown exception
unsigned Hash::partialHash( const string & code )
{
try {
return (code.at(0)*26+code.at(1))*26+code.at(2);
}
catch(std::exception& e){
std::cout << e.what() << std::endl;
}
return 0;
}