mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 07:23:28 +08:00
13 lines
234 B
Go
13 lines
234 B
Go
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)
|
|
}
|