I\'m working in C++ on the Codeblocks IDE. I keep getting this error and can\'t
ID: 3853577 • Letter: I
Question
I'm working in C++ on the Codeblocks IDE. I keep getting this error and can't seem to resolve it I'll post the header file and implementation file below.
C:UsersaronDesktopSchoolSummer 2017CSE 2383 - Data StructuresProjectsHashTableHashTable_Testhash.cpp|5|error: prototype for 'int hashClass::Hash()' does not match any in class 'hashClass'|
//Header
Implementation
ble Test Codc:Blocks 101 earch Preject Build Debug rertran wxSmith Tols Teols+Plugins DexyBloks 5ettings Help malr.cop hach.cpp "hash.hx 5 using nanespace std 7 claaa hashClass public 10 11 hesiclass int Hash (string key) 13 14 15 private 16 17 1 19 20 21tendit int tablesize Lags & athers top schoonsummer 201 0SE 2383 -Data Structures PTojects Hashlable Hashlable_Test hash h Windows ICR L detault Line 11, Column 14 verwnte Modified Read/Wnte detaut OType here to search 11:35 PM 1/2017Explanation / Answer
Just simply change the line
hashClass()::Hash()
to
hashClass()::hashClass()
as this the defintion of the constructor to intitialize the instance variable tablesize and there is no prototype declared in class hashclass for a function called Hash().
The prototype declared is of a function int Hash(string) with a string argument and an Integer return type.