Image

Imagekritof wrote in Imagecpp

Hashing problem...

Can anyone tell me if there's something wrong with these class and struct declarations? I'm having trouble with this program, and maybe it's just because I havent written much C++ in a while.

The program is supposed to create a hash table to store templated data using separate chaining (linearly linked lists). Thanks for any and all help!!!



#include [iostream.h]

template [class D] struct node
{
int key_val;
D data_val;
node* ptr;
};


template [class D] class hash_table
{
private:
node*temp;
int max_size;
node h_table[];
public:
hash_table();
void insert (D& value);
void retrieve (D& value, bool found_it);
bool remove (D& value);
int H(int value) const;

};