how do u walk through a linked list? i've read and don't understand how do do so.
how do u walk through a linked list? i've read and don't understand how do do so.
Perhaps post exactly what it is you are looking at and what you are finding difficult.
Otherwise it is really hard to read your mind as to what you don't understand. And it is quite likely that without providing further details you will simply be pointed to somewhere that has pretty much the same thing that you were having a difficult time reading.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
ok what i need to know how to do is using nodes add a node to the end of the list. But the values i will be adding to the end of the list need to be read from the another linked list which is why i also need to know how to walk through a list. Thats a singly linked list.
http://faq.cprogramming.com/cgi-bin/...&id=1073086407
Note "Traverse".
[edit]Depending on how you have set up your list, this may apply.
Code:for ( item = list; item != NULL; item = item->next )
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
thannks that answered that question, my next one in a doubly linked list how would i define a constructor that takes argumenst tha allow a node to be immediately lined into a list. i have
it doesn't seem right and also how would i define in the header file for a doubly linked list node member fuction to set and retrieve private data member values? i feel like the constructor is what that is for.Code:DLListNode(const T&, DLListNode<T>*,DLListNode<T>*)