Add Pointer Arithmetic

This commit is contained in:
Ginger Bill
2016-10-12 17:51:36 +01:00
parent f5318c46d1
commit f3209584a3
12 changed files with 414 additions and 173 deletions

View File

@@ -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)
}