Link to home
Start Free TrialLog in
Avatar of yaelie
yaelie

asked on

Delete using pointers

Hi I'm running Code Warrior,

I've got a linked list set up using pointers. Can anyone give me the code for deleting an item from the list? I found an algorithm in a book but I'm all confused about the variables etc. Please include the variable decleration and try using normal variable names so I know what youre talking about.
Thanks a bunch!
ASKER CERTIFIED SOLUTION
Avatar of My name is Mud
My name is Mud

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yaelie
yaelie

ASKER

great, and thanx for the quick response. I cannot try this from the computer I'm using right now, I'll try it first thing tomorrow morning and get back to you k?

thank you!!!
Avatar of yaelie

ASKER

whatboy,

I tried doing what you gave me but its not really working. Its basicly choking on the PrevT and the NextT giving me type mismatches.

any idea what i can do?

thanxx..

Avatar of yaelie

ASKER

Also, i forgot to state that I'm dealing with records not single items (ie i'm setting up records with several items in them and want to delete an entire record)
Place the code of the "Type Structure" you're using for the link...
So:...

>>Also, i forgot to state that I'm dealing with records not single items...

Is the same, girl [you are a girl, right???] in fact when creating a link you create it like a sequence of the structure you have [Records] and assign some memory using a pointer, and you delete them by dealocating that memory that the pointer is "pointing" [sorry]...
HELLOOOOoooo... HELLOoooo... HELLooooo... HELloooo... HElloooo... Hellooooo... helloooo... ???
Telephone Line

                                       Hello - how are you
                                       Have you been alright, through all those lonely nights,
                                       That's what I'd say, I'd tell you everything,
                                       If you'd pick up that telephone.

                                       Hey - how you feelin'
                                       Are you still the same
                                       Don't you realize the things we did were all for real not a dream,
                                       I just can't believe
                                       They've all faded out of view.

                                       I look into the sky
                                       And I wonder why

                                       Chorus

                                       Telephone line, give me some time, I'm living in twilight
                                       Telephone line, give me some time, I'm living in twilight

                                       O.K. so no - one's answering,
                                       Well can't you just let it ring a little longer
                                       I'll just sit tight, through shadows of the night
                                       Let it ring for evermore.

                                       Chorus - repeat
Avatar of yaelie

ASKER

sorry for the delay..