Need a function to traverse a linked list

I need a function to traverse a linked list. I am writing a program that stores a bunch of nodes in a linked list...I have no Idea how to actually traverse the linked list I am creating though. Can anyone help me out?
Anyone? An algorithm or pseudocode would be awesome!
there's no trick to it or anything.

Just keep going to the next node until you reach the end of the list.
How do I start and how do I know if I reach the end of the list though?
that depends on how you made the list.

Typically... the list has a 'head' which is the first node in the list, and each node has a 'next' pointer which points to the next node in the list. If the 'next' pointer is null, you've reached the end.
Wow, I was making this much harder than it had to be. Thank you the code works perfect now!
Topic archived. No new replies allowed.