Files
the-way-to-go_ZH_CN/eBook/examples/chapter_4/pointer.go
2013-04-21 19:25:28 -04:00

13 lines
222 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)
}