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