aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-01-26 17:39:44 +0000
committerGinger Bill <bill@gingerbill.org>2017-01-26 17:39:44 +0000
commitf47f25f9420e094f9eafe68b0844b860033da7cc (patch)
treee47e75c280984db06c03afbf6518921f962b15b2 /code
parente85458919ccdd6330a9e090c49343b00468e5b39 (diff)
Fix pointer differences (issue #11); remove #dll_import
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin19
1 files changed, 18 insertions, 1 deletions
diff --git a/code/demo.odin b/code/demo.odin
index 2882a27f2..38ed7a94a 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -11,6 +11,22 @@
main :: proc() {
+ b : [1000]byte;
+
+ using fmt;
+
+ println();
+ println("Pointer of Address 0");
+ println(^b[0]);
+ println();
+ println("Pointer of Address 50");
+ println(^b[50]);
+ println();
+ println("Difference between 50 and 0");
+ println(^b[50] - ^b[0]);
+}
+
+/*
foo :: proc(x: ^i32) -> (int, int) {
fmt.println("^int");
return 123, cast(int)(x^);
@@ -22,7 +38,7 @@ main :: proc() {
THINGI :: 14451;
THINGF :: 14451.1;
- a: i32 = 111111;
+ a: i32 = #line;
b: f32;
c: rawptr;
fmt.println(foo(^a));
@@ -53,3 +69,4 @@ main :: proc() {
f = foo;
f();
}
+*/