From bee5599cc33ca2648236ad11bff677774577cdf0 Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:52:02 -0600 Subject: [PATCH] vault backup: 2024-10-12 20:52:02 --- .../software development/ECE1400/Chapter 9 Exercises.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/education/software development/ECE1400/Chapter 9 Exercises.md b/education/software development/ECE1400/Chapter 9 Exercises.md index 74bec6e..cb7e302 100644 --- a/education/software development/ECE1400/Chapter 9 Exercises.md +++ b/education/software development/ECE1400/Chapter 9 Exercises.md @@ -38,3 +38,12 @@ int check(int x, int y, int n) { > 7. Suppose that function `f` has the following definition: > `int f(int a, int b) { ... }` > Which of the following statements are legal? Assume that `i` has type `int` and `x` has type `double`). + +Answer: +All of them are legal and will compile and run. (c) and (d) are what I would consider bad practice because they perform an implicit conversion from a double to an int, and should include an explicit cast. + +> 8. Which of the following would be valid prototypes for a function that returns nothing and has one double parameter? + +Answer: +(a) and (b). +Parameters must contain a type annotation but theyd o \ No newline at end of file