地址copy,引用copy
func addressCopy() {
i := 7
j := &i
i = 10
fmt.Println(i, *j)//10 10
}
值copy
func valueCopy() {
i := 7
j := i
i = 10
fmt.Println(i, j)//10 7
}
地址copy,引用copy
func addressCopy() {
i := 7
j := &i
i = 10
fmt.Println(i, *j)//10 10
}
值copy
func valueCopy() {
i := 7
j := i
i = 10
fmt.Println(i, j)//10 7
}