Skip to content

Instantly share code, notes, and snippets.

@dumindu
Last active September 25, 2016 01:05
Show Gist options
  • Save dumindu/fb31efa70747f322d33f to your computer and use it in GitHub Desktop.
Save dumindu/fb31efa70747f322d33f to your computer and use it in GitHub Desktop.
let a = [1, 2, 3]; // a[0] = 1, a[1] = 2, a[2] = 3
let mut b = [1, 2, 3];
let c: [int; 3] = [1, 2, 3]; //[Type; NO of elements]
let d: ["my value"; 3]; //["my value", "my value", "my value"];
let e: [i32; 0] = []; //empty array
println!("{:?}", a); //[1, 2, 3]
println!("{:#?}", a);
// [
// 1,
// 2,
// 3
// ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment