Hash Tabel linked lists in C

Write here if you have problems with your C source code

Moderator: Board moderators

Post Reply
koodeGuru
New poster
Posts: 23
Joined: Mon Apr 19, 2004 6:24 am

Hash Tabel linked lists in C

Post by koodeGuru »

I am trying to implement a hash table where each hashtable element is a pointer to a linked list of strings. Here is what my code looks like

Code: Select all

cod removed.........
I am getting lot of errors and started learning c just few days ago . I get this error:
passing arg 2 of `insertSchool' makes integer from pointer without a cast
and also some other errors.

What am I supposed to do now?How do I pass sname to the insertName method to insert it into the string?
Some one please help. Thanks.
Last edited by koodeGuru on Tue May 04, 2004 9:13 am, edited 1 time in total.
koodeGuru
New poster
Posts: 23
Joined: Mon Apr 19, 2004 6:24 am

oops

Post by koodeGuru »

I forgot to mention that:

Code: Select all

variable [b]distArray[/b] stores hashTable elements which are ints
[/b]
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba »

I think you should try to write something easier. Much easier. You have so many bugs in code and you can't even understand compiler's messages.

Few hints:
In struct node, you should have
[c]char name[MAX_CHARACTERS];[/c]or[c]char *name;[/c]not a mix.

Function insertName should take (int, char *) as arguments.

In main(), you should return 0 at the end.

If you declared insertName as void, then you must define it as void too (otherwise insertName is int by default).

You can't assign strings with operator=. Use strcpy() instead.
koodeGuru
New poster
Posts: 23
Joined: Mon Apr 19, 2004 6:24 am

never mind

Post by koodeGuru »

I fixed it. Thanks for your help though. :D
Post Reply

Return to “C”