Here is the linked list class which is of type String:
Code:
template <class T>
class List
{
public:
List();
~List();
void clear ();
void makeLink (const T &nData);
T nodeData;
List *next, *head, *tail;
};
Code:
struct String
{
char str[MAX];
int result;
int hashKey;
friend ostream& operator <<(ostream& out, String& wrd);
void operator= (List *head);
int operator== (const String& wrd) const;
int operator < (const String& wrd) const;
int operator > (const String& wrd) const;
};
//------------------------------------------------------------------------------
void String::operator= (List *head)
{
head=NULL;
}
Here I am trying to create an array of linked lists in the hash t
Code:
//---------------------------CONSTRUCTOR---------------------------------
template <class T>
HashTable<T>::HashTable ()
{
size=0;
for (long i=0; i< MAX_SIZE; i++)
htable[i]= new List<T>; <----array of linked list created ??
}
The error message I am receiving is :
'List' : use of class template requires template argument list
see declaration of 'List'
I am not to sure how I can overcome this problem