Add Pointer Arithmetic
This commit is contained in:
1 parent
f5318c46d1
commit
f3209584a3
12 files changed
+414
-173
No files matched your search
@@ -1,5 +1,15 @@
|
||||
#import "fmt.odin"
|
||||
|
||||
main :: proc() {
|
||||
Vec3 :: struct {
|
||||
x, y: i16
|
||||
z: ?i32
|
||||
}
|
||||
a := [..]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
|
||||
offset: u8 = 2
|
||||
ptr := ^a[4]
|
||||
|
||||
|
||||
fmt.println((ptr+offset) - ptr)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user