how to create and allocate memory for hash table

How to create and allocate memory for hash table in C language/
woeishyongAsked:
Who is Participating?
 
TommySzalapskiConnect With a Mentor Commented:
It's a hash table so just make an array and hash for the index.

Example
int hashtable[256];

Open in new window

void Hash(int* hashtable, int numToHash)
{
  hashtable[numToHash%256] = numToHash
}

Open in new window


If you need more help, provide more details.
0
 
evilrixConnect With a Mentor Senior Software Engineer (Avast)Commented:
>> How to create and allocate memory for hash table in C language/
Dynamically? Use malloc & free.

http://www.cplusplus.com/reference/clibrary/cstdlib/malloc/
http://www.cplusplus.com/reference/clibrary/cstdlib/free/
0
 
Infinity08Commented:
This looks like a duplicate of http://www.experts-exchange.com/Programming/Languages/C/Q_26612981.html
Since duplicate questions are not allowed, please delete one of them, and only keep the one where you want to continue.
0
 
TommySzalapskiCommented:
I'm guessing he wanted to ignore the other one since he posted it in the wrong area. Must not have known we could move it for him.
0
 
evilrixSenior Software Engineer (Avast)Commented:
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0
All Courses

From novice to tech pro — start learning today.