[prev] [index] [next]

Dynamic Data Structures (cont)

Creating a new list through iteration
  • the wrong way

    NodeT *list;
    int i;
    for (i = 1; i < N; i += 2) {  // fill list with odd numbers
    	list = makeNode(i);   // create new node     
    	list = list->next;    // move forward
    }
    printList(list);