4 Replies - 1223 Views - Last Post: 12 January 2011 - 11:49 AM Rate Topic: -----

#1 monopolis  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 58
  • Joined: 21-April 10

hash table

Posted 12 January 2011 - 11:16 AM

hello ,
i need help with hash table

i want to make a hash table and i want this hashtable to point to a new tableP to put element to the tableP i hope you understand what i mean im thinging the structs would be likes this

typedef struct element{
	long **keys_table;
	int point;
	struct element *next;
}elem;

typedef struct hashtable{
	long size;
	long offset;
	elem **table;	
}hash_table;


i need your opionion or if there is a more easiest way to do it

MOD EDIT: You also need help with CODE TAGS! When posting code, obey the rules and USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 12 January 2011 - 01:20 PM


Is This A Good Question/Topic? 0
  • +

Replies To: hash table

#2 vividexstance  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 651
  • View blog
  • Posts: 2,240
  • Joined: 31-December 10

Re: hash table

Posted 12 January 2011 - 11:19 AM

for the hash table itself, you might try using classes instead of structs, and if you don't have to make the hash table yourself, then just use the STL(Standard Template Library).
Was This Post Helpful? 0
  • +
  • -

#3 monopolis  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 58
  • Joined: 21-April 10

Re: hash table

Posted 12 January 2011 - 11:22 AM

im have to do it myself im not sure i understand what class is im a little bit confused
Was This Post Helpful? 0
  • +
  • -

#4 vividexstance  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 651
  • View blog
  • Posts: 2,240
  • Joined: 31-December 10

Re: hash table

Posted 12 January 2011 - 11:37 AM

A struct is a type of class. Just use structs then until you learn about classes, but if your learning C++ then you should really take a look at classes. I'm sure you could find some info on this site or google about classes. Or even in whatever programming books you have.
Was This Post Helpful? 0
  • +
  • -

#5 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3101
  • View blog
  • Posts: 19,140
  • Joined: 14-September 07

Re: hash table

Posted 12 January 2011 - 11:49 AM

Read Me
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1