#include #include struct ListNode { int data; struct ListNode *next; }; struct ListNode first; struct ListNode second; struct ListNode third; // Print a list void printList(struct ListNode *node) { while (node != NULL) { printf("%d ", node->data); node = node->next; } printf("\n"); } // Connect first, second, and third into a linked list. void makeList(int *values) { first.data = values[0]; first.next = &second; second.data = values[1]; second.next = &third; third.data = values[2]; third.next = NULL; } // The program starts from here int main(int argc, char *argv[]) { if (argc != 4) { printf("You gave me %d inputs, I expected 3\n", argc); return 1; } // Read three values from the command line int values[3]; values[0] = strtol(argv[1], NULL, 0); values[1] = strtol(argv[2], NULL, 0); values[2] = strtol(argv[3], NULL, 0); makeList(values); // Print those three values printList(&first); printf("Exiting\n"); return 0; }