Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
10
Task/Variable-size-Get/Rust/variable-size-get.rs
Normal file
10
Task/Variable-size-Get/Rust/variable-size-get.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
use std::mem;
|
||||
|
||||
fn main() {
|
||||
// Specify type
|
||||
assert_eq!(4, mem::size_of::<i32>());
|
||||
|
||||
// Provide a value
|
||||
let arr: [u16; 3] = [1, 2, 3];
|
||||
assert_eq!(6, mem::size_of_val(&arr));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue