diff --git a/lectures/04_pointers/README.md b/lectures/04_pointers/README.md index 1afef7f..fc6e6a0 100644 --- a/lectures/04_pointers/README.md +++ b/lectures/04_pointers/README.md @@ -146,7 +146,39 @@ shrink dynamically in response to the demands of the application. - play this [animation](https://jidongxiao.github.io/CSCI1200-DataStructures/animations/pointers/example_arrays_1/index.html). -## 4.8 Sorting an Array +## 4.8 Stepping through Arrays with Pointers (Array Iterators) + +- The array code above that uses [] subscripting, can be equivalently rewritten to use pointers: +```cpp +const int n = 10; +double a[n]; +double *p; +for ( p=a; p