#include #include "list.h" int main(int argc, char *argv[]) { List_T list; List_iterator_T p; int i; list = List_new(); /* * Insert the command line arguments in the list. Each argument is * inserted in the end of the list. */ for (i = 0; i < argc; i++) { List_insert(list, List_end(list), argv[i]); } /* * Traverse the list printing its contents. */ for (p = List_begin(list); p != List_end(list); p = List_next(p)) { printf("%s\n", List_element(list, p)); } List_delete(&list); return 0; }