For a while I've been stuck on something and I couldn't get out of it,
Simply, I'm trying to create and linked list while using "stack" method, and as I'm doing this, I must
use Hashing algorithm, I'm so alien to linked list, after I worked on them I understood the logic of
it, but still Im having many problems.

First Of All, while doing hashing in linked list, I have to declare an Array and Each item in
the array is a pointer to the linked list (stack) of the input(ID,number..) mapped to that index.

According to my understandings I've created this kind of algorithm but first I ve tried to do it
without using any hashing, I tried to do simple stack program, now I want to add hashing function
into this, however I got confused, everything got confused...

Here is my program, what do you think thet where I'm wrong at, and where I'm supposed to work on or change,

I must've done somethings wrong, because even doing a simple stack, everything goes wrong, because when I enter an ID and name, then I searched it, or list it, after listing or searching, if I want to list or search second time, it doesnt give anything, I 'm not sure but I think because of some reason program lost the head of stack. Maybe I declared something globally that's why it happens but I dont know :(

04-07-2007

quzah

You have a local variable called 'head', and a global variable called 'head'. Which one are you trying to actually use? The function main is not a void function. It returns an int; read the FAQ on it. You last function listed is missing a }, but I'll assume it got missed in the copy-paste.

Quzah.

04-07-2007

m0ntana

Actually I gotta use the head which is in main one, but while I'm trying to fix the program up, I must have put the second head as globally... As I said I got so confused ...
And last } got missed in the copy paste as u said.