From f5c0b5f1bf8adb228fab4b50aeaec252618ccd60 Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:01:54 -0600 Subject: [PATCH] vault backup: 2024-10-25 14:01:54 --- .../software development/ECE1400/Chapter 11 Exercises.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/education/software development/ECE1400/Chapter 11 Exercises.md b/education/software development/ECE1400/Chapter 11 Exercises.md index 977ee81..e032e2a 100644 --- a/education/software development/ECE1400/Chapter 11 Exercises.md +++ b/education/software development/ECE1400/Chapter 11 Exercises.md @@ -9,4 +9,7 @@ ```c middle = (low + high) / 2 ``` -The above statement is illegal because you can't add two pointers together \ No newline at end of file +The above statement is illegal because you can't add an `int *` to an `int *`. It can be made legal by casting `low` and `high` to numbers, performing the operation, then casting to a pointer. +```c +middle = (int*) (((long) low + (long) high) / 2); +``` \ No newline at end of file