From e7a887c7a0a4344a809a602c9e918a9dc15bf3b8 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 16 Mar 2015 16:56:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eBook/07.2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eBook/07.2.md b/eBook/07.2.md index 1f19ade..9559774 100644 --- a/eBook/07.2.md +++ b/eBook/07.2.md @@ -209,7 +209,7 @@ make 的使用方式是:`func make([]T, len, cap)` 其中 cap 是可选参数 这样分配一个有 50 个 int 值的数组,并且创建了一个长度为 10,容量为 50 的 slice v,该 slice 指向数组的前 10 个元素。 -问题 7.3:给定 `s := make([]byte, 5)`,len(s) 和 cap(s) 分别是多少?`s = s[2:4]`,len(s) 和 cap(s) 又分别是多少? +问题 7.3:给定 `s := make([]byte, 5)`,len(s) 和 cap(s) 分别是多少?`s = s[2:4]`,len(s) 和 cap(s) 又分别是多少? 问题 7.4:假设 `s1 := []byte{'p', 'o', 'e', 'm'}` 且 `s2 := d[2:]`,s2 的值是多少?如果我们执行 `s2[1] == 't'`,s1 和 s2 现在的值又分配是多少? ## 7.2.5 多维 slice