September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -1 +1 @@
|
|||
i := sizeof([any variable or structure]);
|
||||
i := sizeof({any variable or data type identifier});
|
||||
|
|
|
|||
2
Task/Variable-size-Get/Forth/variable-size-get-1.fth
Normal file
2
Task/Variable-size-Get/Forth/variable-size-get-1.fth
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
: .CELLSIZE ( -- ) CR 1 CELLS . ." Bytes" ;
|
||||
VARIABLE X ( creates a variable 1 cell wide)
|
||||
4
Task/Variable-size-Get/Forth/variable-size-get-2.fth
Normal file
4
Task/Variable-size-Get/Forth/variable-size-get-2.fth
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
.CELLSIZE
|
||||
4 Bytes ok
|
||||
-1 X ! ok
|
||||
HEX X @ U. FFFFFFFF ok
|
||||
10
Task/Variable-size-Get/Rust/variable-size-get.rust
Normal file
10
Task/Variable-size-Get/Rust/variable-size-get.rust
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