• C

how to create and allocate memory for hash table

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

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.
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.

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.
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.
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.