From d4ec81f8453ecc5ded0d2c2843c952ab27d19642 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Tue, 1 Apr 2025 23:46:55 +0200 Subject: Feature: Start adding support for assigning to pointers with arithmetic --- examples/18.src | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/18.src') 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; }; -- cgit 1.4.1