C help

Associate
Joined
15 Jul 2011
Posts
1,528
Location
London
Ive been stuck on a section of my C work for 6 hours now

its probobly something really obvious

http://pastebin.com/trVaftnY

it reads into a linked list (from the values at the top)

sorts them

outputs

simple in reality but i keep getting the valgrind error at the bottom of the PB

cheers guys!
 
Thanks very much, fixed a bunch of that, and created and end of list variable but im a bit confused how i would keep track of it.. as i dont just add to the end of the list at any point

edit i see the first not the last ok..

ill give that a go!
 
Last edited:
Ok i added a first and now send the start of the list in my call as follows...

http://pastebin.com/7n8hMtR4

now i dont get a segfault but just

Person: Alfred, Age: 106
Person: Harriet, Age: 24
Person: Tim, Age: 32

in ouput. stumped.
 
Back
Top Bottom