为了账号安全,请及时绑定邮箱和手机立即绑定

来自地图的 Foreach 去

来自地图的 Foreach 去

Go
湖上湖 2021-10-25 18:13:45
// define structure typetype my_struct struct {  a int  b rune}// declare slice of my_structvar a []my_struct// declare and initialise struct with one element b := make([]my_struct, 1)// create structure and save itb[0] = my_struct{1, 'a'}// append a new oneb = append(b, my_struct{2, 'b'})您绝对必须阅读https://golang.org/doc/effective_go.html,尤其是关于结构和切片的内容,如果您想了解更多的话。
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 207 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号