wiki:Types/Array

Array AKA Vector

Collection of values (objects) of the same data type in a continuous block of memory.

  • A concrete or implementation-constrained type. A particular kind of a Sequence
  • Usually stack-allocated (implementation-dependent).
  • The size is known (and could be checked) at compile-time.
  • Some languages (Go and Rust) has the type of a Slice of an Array (usually a pointer and size).

an array

let xs: [i32; 5] = [1, 2, 3, 4, 5];

a slice

let ys = &xs;
// shadowing
let ys = &xs[1..4];
Last modified 3 years ago Last modified on Mar 31, 2018, 7:44:12 AM
Note: See TracWiki for help on using the wiki.