i'm trying to create a chained hash table using a linked list header file, but there's a problem with my insert function. here's the relevant portion. the error comes in the part that is in red. compiler says "parse error before '.' "
i've used the linked list header before, so i know it works. also, if i take the line in question & replace LinkedList.add(value) with 25 (for example) it works fine - of course, it just inserts it in the hash table array. i think i'm using the LinkedList.add() function incorrectly. can anyone help?
#include "linkedlist.h"
int main()
{
HashTable Hash7(7);
LinkedList MyList;
Hash7.Insert(8);
system("PAUSE");
return 0;
}
bool HashTable::Insert(const Item &value){
int Pos = HashFunction(value);
//LinkedList.add(3); gave same error
//MyList.add(value); gave error "MyList undeclared"
MyTable[Pos].status = Occupied;
MyTable[Pos].value = LinkedList.add(value);
cout<<"value in pos "<<Pos<<" is "<< MyTable[Pos].value<<endl;
}