Skip to content

Commit

Permalink
fix: typo (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsuo authored May 26, 2022
1 parent 1573212 commit 36742d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eBook/07.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ arr2[2] = 100

所以在函数中数组作为参数传入时,如 `func1(arr2)`,会产生一次数组拷贝,`func1()` 方法不会修改原始的数组 `arr2`

如果你想修改原数组,那么 `arr2` 必须通过 `&` 操作符以引用方式传过来,例如 `func1(&arr2`,下面是一个例子:
如果你想修改原数组,那么 `arr2` 必须通过 `&` 操作符以引用方式传过来,例如 `func1(&arr2)`,下面是一个例子:

示例 7.2 [pointer_array.go](examples/chapter_7/pointer_array.go):

Expand Down

0 comments on commit 36742d0

Please sign in to comment.