Implementation of hashing algorithm with arrays and c++ strings - Segmentation fault (core dumped) -
i'm getting "segmentation fault (core dumped)" error, when hash-function gives similar hash-values. both "hash" , "hash" functions should stay way are. "keyvalue" part of assignment, not exact implementation, numbers should upper case (hence "toupper" function) , start @ 1 (for example a=1, b=2 etc.). guess "hashinsert" 1 making problems, unfortunately couldn't figure out on own. (and should use arrays) #include <iostream> #include <string> using namespace std; /**********************/ int toupper( int ); int keyvalue( int ); int hash( int ); int hash( int ); int hashvalue( string, int ); void hashinsert( string[], string ); /**********************/ const int days = 7; string week[days]; int keyvalue( int ch ){ return toupper(ch) - 64; } int toupper( int ch ){ if( ch >= 92 && ch <= 122 ) return ch - 32; return ch; } int hash( int ch ){ return keyvalue( ch ) % ...