CSC209H5 Midterm: CSC209H UTM Test Midterm12s eve Solution 280

65 views4 pages
31 Jan 2019
School
Course
Professor

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents