package main
import "fmt"
type Employee struct {
ID int
Name string
}
func main(){
var zhexiao Employee
zhexiao.Name = "xiao"
fmt.Println(&zhexiao)
x := 1
p := &x
fmt.Println(p)
}
The above code outputs two kinds of pointers.
- struct pointer output is:
&{0 xiao}
- integer pointer output is:
0xc0420600b0
(it looks like a memory address)
Why struct pointer output is not a memory address? If it's not memory address, what is it?
Thanks a lot Zhe