package main
import (
"fmt"
)
func myfun(a []int){
fmt.Println(a)
a[0] = 8
a[1] = 8
a[2] = 8
fmt.Println(a)
}
func main() {
a := make([]int,3)
a[0] = 1
a[1] = 2
a[2] = 3
myfun(a)
fmt.Println(a)
}
有疑问加站长微信联系(非本文作者)