type Student struct{
    name string
    age int
}

var stu Student
stu.name,stu.age = "张三”,10

stu2 := Student{"李四",20}

stu3 :=  new(Student) //stu3是一个指针

 

相关文章:

  • 2022-12-23
  • 2022-02-19
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2021-08-30
  • 2021-06-25
  • 2021-05-29
猜你喜欢
  • 2022-01-30
  • 2022-01-31
  • 2021-05-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
相关资源
相似解决方案