Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m working in C++ with Codeblocks IDE. I keep getting this invalid use of memb

ID: 3853594 • Letter: I

Question

I'm working in C++ with Codeblocks IDE. I keep getting this invalid use of member for line 25 in the implementation file. Ive included the header file and implementation file below. Could somebody please help debug

//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/2017

Explanation / Answer

The line 25 in the implementation file is

index = Hash % tableSize;

There is no Hash variable defined anywhere in the header file or in the implementation file and the hash is being calculated in hash1 variable. Hence the code should be,

index = hash1 % tableSize; // this will solve the error and is also gives the correct hashed index.