![image.png](https://static.studygolang.com/180110/39eb57e7aa9be80e9fc7bb1242fefb03.png)
![image.png](https://static.studygolang.com/180110/a2b46e26249c56355348d5a01270180a.png)
**看下面代码,或许对你有启发**
```go
func main(){
var student Student
println(&student)
for i:=0;i<2;i++{
var stu Student
println(&stu)
stu.Key=strconv.Itoa(i)
student=stu
println(&student)
}
}
```
> 0xc420039f38
> 0xc420039f58
> 0xc420039f38
> 0xc420039f58
> 0xc420039f38
```go
func main(){
var student *Student
println(&student)
for i:=0;i<2;i++{
var stu Student
println(&stu)
stu.Key=strconv.Itoa(i)
student=&stu
println(student)
}
}
```
> 0xc420039f68
> 0xc42000a500
> 0xc42000a500
> 0xc42000a520
> 0xc42000a520
#9
更多评论