lylex / lylex.github.io

Let's write something down

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go杂谈--array和slice | lylex's humble Home

lylex opened this issue · comments

commented

http://qianzhou.tech/2019/01/03/go-array-and-slice/

go杂谈–array和sliceArray是几乎所有我们见到的编程语言中都有的这么一个东西,而slice似乎是go特有的。这里我们就稍微花点时间,来杂谈漫谈一下这两个东西,以期避其坑,用其长。 关于Array和其他语言中的数组一样,go语言中的数组是同一种类型的集合,并且它是定长度的。它是一种组合类型,传入时候,是值传递的,不像C++中还有所谓的地址属性。概念上,它更像一个结构体对象。如果有什么需