We'll show how pointers work in contrast to values with 2 functions: `zeroval` and `zeroptr`. `zeroval` has an `int` parameter, so arguments will be passed to it by value. `zeroval` will get a copy of `ival` distinct from the one in the calling function.
(ival int)
| 12 | // value. `zeroval` will get a copy of `ival` distinct |
| 13 | // from the one in the calling function. |
| 14 | func zeroval(ival int) { |
| 15 | ival = 0 |
| 16 | } |
| 17 | |
| 18 | // `zeroptr` in contrast has an `*int` parameter, meaning |
| 19 | // that it takes an `int` pointer. The `*iptr` code in the |