From 77e7cdf760ca1e158cfba7a6ab67b01f5c96ef89 Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Mon, 28 Oct 2024 11:20:14 -0600 Subject: [PATCH] vault backup: 2024-10-28 11:20:14 --- .../software development/ECE1400/Chapter 12 Exercises.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/education/software development/ECE1400/Chapter 12 Exercises.md b/education/software development/ECE1400/Chapter 12 Exercises.md index 19223e9..73b44da 100644 --- a/education/software development/ECE1400/Chapter 12 Exercises.md +++ b/education/software development/ECE1400/Chapter 12 Exercises.md @@ -24,4 +24,11 @@ The following expressions are illegal because of mismatched types: - (a) `p == a[0]` - Comparison between `int *` and `int` The rest of the expressions are true. -8. \ No newline at end of file +8. Rewrite the following function to use pointer arithmetic... +```c +void store_zeros(int *a, int n) { + for (int i = 0; i < n; i++) { + *(a + i) = 0; + } +} +``` \ No newline at end of file