The *next command(?) in C

Hi,

I've been looking through the source for the calcurse program, and I keep coming across code that looks like this:

i->next

...which comes from a structure that looks a bit like this:

struct example_s
{
struct example_s *next;
...
}

I've been trying to find out what this does exactly. Looking at various C pages, it has something to do with a tree node? Is the C++ equivalent the for_each for a vector (assuming you put the structure/class into that vector)? I've tried to make a small program that shows me what this does, but, to no avail. Would someone please provide a small example of what the *next operator does? Thank you.
Google "linked list".
Thanks Duoas.

I ended up doing the example at:

http://www-h.eng.cam.ac.uk/help/tpl/languages/C/teaching_C/node44.html

...and I figured it out.
Brilliant!

Five gold stars for you. You ought to hang out here and help others too. (Seriously)
Sure thing.

I'm learning all sorts of stuff reading source code. I'll do what I can.
Topic archived. No new replies allowed.