#include #include using namespace std; size_t hash(char const* str, int mult) { size_t h = 0; for (; *str; ++str) { h = mult * h + *str; } return h ; } void main(){ string *as[101] = {0}; char *s[] = {"Steve","Michele","Rich","Steven","Ted","Brendan","Veronica"}; for(int i = 0; i < 7; i++){ int ind = hash(s[i],13)%101; cout << ind << endl; as[ind] = new string(s[i]); } cout << *as[(hash("Veronica",13)%101)] << endl; }