class table { private: char **adtHashTable; public: table(const int hashsize) { adtHashTable = new char[hashsize][1024]; } } int table::adtHashFunction(const int hashsize, char * cpKey) { table t; adtHashPosition = 0; int len = strlen(cpKey)+1; char cpKeyArray[len]; char adtHashTable[hashsize+1][len+1]; for(int i = 0; i < hashsize; i++) { adtHashTable[i][0] = '\0'; } for(int i = 0; i < strlen(cpKey); i++) { //add each letter of the clients key for the hash position adtHashPosition = adtHashPosition + cpKey[i]; } //mod hash position by 1009 to get a constrained number adtHashPosition = adtHashPosition % hashsize; if(adtHashTable[adtHashPosition][0] == '\0') { cout << adtHashTable[adtHashPosition-1] << endl; //cout << adtHashPosition << endl; strcpy(adtHashTable[adtHashPosition],cpKey); cout << adtHashTable[adtHashPosition] << endl; } else { //LINKED LIST STUFF HERE! cout << adtHashTable[adtHashPosition-1] << endl; cout << adtHashPosition << endl; cout << "ERRRRROOOOOORRRRR! STUFFS HUR!" << endl; } return 1; }