【与数组相比】
切片只规定元素的类型,不规定元素个数
【练习】
使用切片(slice)组成一个2维切片结构。外层切片有三个元素,内层切片分别有1,2,3个元素。
Slices can be composed into multi-dimensional data structures. The length of the inner slices can vary, unlike with multi-dimensional arrays.
【与数组相比】
切片只规定元素的类型,不规定元素个数
【练习】
使用切片(slice)组成一个2维切片结构。外层切片有三个元素,内层切片分别有1,2,3个元素。
Slices can be composed into multi-dimensional data structures. The length of the inner slices can vary, unlike with multi-dimensional arrays.