how to create and allocate memory for hash table

Posted on 2010-11-13
Medium Priority
Last Modified: 2012-05-10
How to create and allocate memory for hash table in C language/
Question by:woeishyong
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 37

Accepted Solution

TommySzalapski earned 1000 total points
ID: 34128535
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.
LVL 40

Assisted Solution

evilrix earned 1000 total points
ID: 34128640
>> How to create and allocate memory for hash table in C language/
Dynamically? Use malloc & free.

LVL 53

Expert Comment

ID: 34130075
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.
LVL 37

Expert Comment

ID: 34130799
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.
LVL 40

Expert Comment

ID: 34824219
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.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question