mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:43:26 +08:00
漏掉了一个右大括号符
This commit is contained in:
@@ -10,7 +10,7 @@ Go 语言的取地址符是 `&`,放到一个变量前使用就会返回相应
|
||||
下面的代码片段(Example 4.9 [pointer.go](examples/chapter_4/pointer.go))可能输出 `An integer: 5, its location in memory: 0x6b0820`(这个值随着你每次运行程序而变化)。
|
||||
|
||||
var i1 = 5
|
||||
fmt.Printf(“An integer: %d, it’s location in memory: %p\n”, i1, &i1)
|
||||
fmt.Printf("An integer: %d, it's location in memory: %p\n", i1, &i1)
|
||||
|
||||
这个地址可以存储在一个叫做指针的特殊数据类型中,在本例中这是一个指向 int 的指针,即 `i1`:此处使用 *int 表示。如果我们想调用指针 intP,我们可以这样声明它:
|
||||
|
||||
@@ -125,4 +125,4 @@ Example 4.23 [testcrash.go](examples/chapter_4/testcrash.go):
|
||||
##链接
|
||||
- [目录](directory.md)
|
||||
- 上一节:[时间和日期](04.8.md)
|
||||
- 下一节:[控制结构](05.0.md)
|
||||
- 下一节:[控制结构](05.0.md)
|
||||
|
Reference in New Issue
Block a user