Class to manage a linked list. Utility that can be built on or used alone
Dependents: Waldo_Embed_V2 elevator_with_queue RaheeNew DS1820 ... more
Good information on linked list basics here.
#include "mbed.h" #include "LL.h" LL<node>list; int main() { node *tmp; list.push((char *)"Two\n"); list.append((char *)"Three\n"); list.append((char *)"Four\n"); list.push((char*)"One\n"); list.append((char*)"Five\n"); for(int i=1; i<=list.length(); i++) { tmp = list.pop(i); printf("%s", (char *)tmp->data ); } error("done\n"); }
Diff: LinkedList.cpp
- Revision:
- 4:59b2aa82b517
- Parent:
- 3:c14e7a918e21
- Child:
- 5:28e11c75b433
--- a/LinkedList.cpp Mon Apr 08 22:23:25 2013 +0000 +++ b/LinkedList.cpp Wed Apr 10 06:17:21 2013 +0000 @@ -26,9 +26,9 @@ template<class retT> LinkedList<retT>::LinkedList() { - // clear the members + // clear the member _head = 0; - _head->next = 0; +// _head->next = 0; return; }