From a69a795aadff8f0641461b980212f6b4335c7978 Mon Sep 17 00:00:00 2001 From: Spirit Date: Sat, 17 Oct 2015 18:44:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=BB=93=E6=9E=84=E4=BD=93?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eBook/10.1.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eBook/10.1.md b/eBook/10.1.md index aa9d62a..09b9e50 100644 --- a/eBook/10.1.md +++ b/eBook/10.1.md @@ -228,7 +228,7 @@ type Node struct { type Node struct { pr *Node data float64 - su *su + su *Node } ``` @@ -285,7 +285,7 @@ func main() { 提示: VCard 必须包含住址,它应该以值类型还是以指针类型放在 VCard 中呢? 第二种会好点,因为它占用内存少。包含一个名字和两个指向地址的指针的 Address 结构体可以使用 %v 打印: - {Kersschot 0x126d2b80 0x126d2be0} + {Kersschot 0x126d2b80 0x126d2be0} **练习 10.2** persionext1.go: @@ -293,7 +293,7 @@ func main() { **练习 10.3** point.go: -使用坐标 X、Y 定义一个二维 Point 结构体。同样地,对一个三维点使用它的极坐标定义一个 Polar 结构体。实现一个 `Abs()` 方法来计算一个 Point 表示的向量的长度,实现一个 `Scale` 方法,它将点的坐标乘以一个尺度因子(提示:使用 `math` 包里的 `Sqrt` 函数)(function Scale that multiplies the coordinates of a point with a scale +使用坐标 X、Y 定义一个二维 Point 结构体。同样地,对一个三维点使用它的极坐标定义一个 Polar 结构体。实现一个 `Abs()` 方法来计算一个 Point 表示的向量的长度,实现一个 `Scale` 方法,它将点的坐标乘以一个尺度因子(提示:使用 `math` 包里的 `Sqrt` 函数)(function Scale that multiplies the coordinates of a point with a scale factor)。 **练习 10.3** rectangle.go: