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:
- 6:e3ab7684c395
- Parent:
- 5:28e11c75b433
- Child:
- 7:4ed66162aaa8
--- a/LinkedList.cpp Mon May 13 04:38:05 2013 +0000 +++ b/LinkedList.cpp Tue May 14 23:06:11 2013 +0000 @@ -28,7 +28,6 @@ { // clear the member _head = 0; -// _head->next = 0; return; }