标签:int 类型 语言 bsp class string Go语言 str 自定义
1.自定义数组类型
type dics struct {
        hello string
        id    int
        value float32
    }
//申明变量 为定义的类型,传值
    var a dics
    a.hello = “go语言”
    a.id = 2
    a.value = 1.21
2.、自定义变量类型,赋给指针
func main() {
    type dics struct {
        hello string
        id    int
        value float32
    }
    var a dics
    a.hello = "goèˉ-言"
    a.id = 2
    a.value = 1.21
    var aa *dics
    aa = &a
    fmt.Println(aa.hello)
}
标签:int 类型 语言 bsp class string Go语言 str 自定义
原文地址:https://www.cnblogs.com/Jack-cx/p/10182643.html