#include #include #include #include "ll.h" int main(int argc, char **argv) { Node *list = NULL; Node *tmp; int ret; // Push two elements on the list. Note that // the memory that the variables 'hi' and 'bye' // point to is allocated and initialized to contain // the strings "hello" and "goodbye" when the program // is loaded; we don't have to worry about free()'ing // that memory as a result. list = Push(list, 17); list = Push(list, 42); // Iterate through the list. tmp = list; while (tmp != NULL) { printf("payload %d\n", tmp->element); tmp = tmp->next; } // Pop the list elements and print them. ret = Pop(list, &list); printf("popped %d\n", ret); ret = Pop(list, &list); printf("popped %d\n", ret); return EXIT_SUCCESS; }