mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:21:38 +08:00
update book code
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var i1 = 5
|
||||
fmt.Printf("An integer: %d, its location in memory: %p\n", i1, &i1)
|
||||
|
||||
var intP *int
|
||||
intP = &i1
|
||||
fmt.Printf("The value at memory location %p is %d\n", intP, *intP)
|
||||
}
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
var i1 = 5
|
||||
fmt.Printf("An integer: %d, its location in memory: %p\n", i1, &i1)
|
||||
|
||||
var intP *int
|
||||
intP = &i1
|
||||
fmt.Printf("The value at memory location %p is %d\n", intP, *intP)
|
||||
}
|
||||
|
Reference in New Issue
Block a user