about summary refs log tree commit diff
path: root/examples/18.src
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-04-01 23:46:55 +0200
committerBaitinq <[email protected]>2025-04-01 23:47:14 +0200
commitd4ec81f8453ecc5ded0d2c2843c952ab27d19642 (patch)
tree89af68c5f2b9c5552e95c70d6f2fba44b3d1d7a2 /examples/18.src
parentEvaluator: Remove evaluator (diff)
downloadpry-lang-d4ec81f8453ecc5ded0d2c2843c952ab27d19642.tar.gz
pry-lang-d4ec81f8453ecc5ded0d2c2843c952ab27d19642.tar.bz2
pry-lang-d4ec81f8453ecc5ded0d2c2843c952ab27d19642.zip
Feature: Start adding support for assigning to pointers with arithmetic
Diffstat (limited to 'examples/18.src')
-rw-r--r--examples/18.src10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/18.src b/examples/18.src
index 90234c4..6d75e30 100644
--- a/examples/18.src
+++ b/examples/18.src
@@ -4,13 +4,13 @@ extern free = (*i64) => void;
 
 let main = () => i64 {
 	let x = malloc(128);
-	/*
-	*(x+0) = 10;
-	*(x+8) = 20;
-	*/
+	(*(x+0)) = 10;
+	(*(x+1)) = 20;
+	(*(x+2)) = 40;
 	printf("%p\n", x);
-	printf("%d\n", *x);
+	printf("%d\n", *(x+0));
 	printf("%d\n", *(x+1));
+	printf("%d\n", *(x+2));
 	free(x);
 	return 0;
 };