//createFixedStack.c //John T. Rine //October 12, 2011 #include #include #include"all.h" void createFixedStack(node **head, node **tail, int elements) { int i; node *new; new = NULL; *head = *tail = NULL; for(i = 1; i<=elements; i++) { if (*head == NULL) { *head = (node *) malloc(sizeof(node)); *tail = *head; (*head)->prev = NULL; (*head)->next = NULL; } else { new = (node *) malloc(sizeof(node)); new->prev = *tail; new->next = NULL; (*tail)->next = new; *tail = new; } } }