compound types
This commit is contained in:
commit
aaa0c9143e
31 changed files with 38 additions and 0 deletions
10
src/main.rs
Normal file
10
src/main.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
fn main() {
|
||||
let mut a: [i8; 10] = [42; 10];
|
||||
a[5] = 0;
|
||||
println!("a: {:?}", a);
|
||||
|
||||
// so this is assigning an immutable tuple
|
||||
let t: (i8, bool) = (7, true);
|
||||
println!("t 1st: {}", t.0);
|
||||
println!("t 2nd: {}", t.1);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue