A simple example of hashtable source code
I was looking at that example snippet. I tried compiling it but it didnt work. My compiler complains about the node declaration part: Node defined as both function and variable
Code:
struct NODE
{
Node(const char* Key1 = "\0", const char* fName = "\0",
const char *tele ="\0", const double sal = 0.0 )
{
strcpy(Key, Key1);
strcpy(FullName, fName);
strcpy(Tele_No, tele);
Salary = sal;
Tax = 0.005 * Salary;
next = NULL;
}
char Key[SIZE_KEY];
char FullName[SIZE_VALUE1];
char Tele_No[SIZE_VALUE2];
double Salary;
double Tax;
Node *next;
};
Notice the second node is defined as a function. Thats what I was confused about as well... while looking at the code, and so decided to test it out.