CSC209H5 Midterm: CSC209H UTM Test Midterm12s eve Solution 280
Document Summary
In each subquestion below, ll in the box with the declaration for an appropriate mystery function so that the following code would compile without error. [4 marks] int mystery1(double *, int, char *); double price; int * position; char ** products; /* assume that these variables are initialized properly here */ if (mystery1(&price, *position, products[3]) != 0) { fprintf(stderr, "error with mystery 3\n"); [3 marks] char * mystery2(int, char ***); int rating[3] = {4, 5, 10}; char ** items; char name[30]; strncpy(name, mystery2(rating[2], &items), 29); On the next page write a shell program longer that takes two lenames as command line arguments and prints to standard output the content of the le that is longer. By default, length is determined as the number of lines, but if the script is called with an optional -w argument (that must come before the. Lenames), it determines length based on the number of words instead.