traversing a linked list

when i am traversing a linked list ...i suppose we can do it only with pointers
like p is a head node pointer then
p
p->next
p->next->next
p-next->next->next

so on represents a link...

if i have to pass head node as struct variable itself...can i traverse a link

using dot operator??

p and p.next and how to retrieve third and remaining links through this method if we can traverse like this???

please help...i am new to c++

thanks
Perhaps this could be done if you link by reference instead of linking with pointers.
Topic archived. No new replies allowed.