diff options
| author | Baitinq <[email protected]> | 2025-04-01 23:46:55 +0200 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-04-01 23:47:14 +0200 |
| commit | d4ec81f8453ecc5ded0d2c2843c952ab27d19642 (patch) | |
| tree | 89af68c5f2b9c5552e95c70d6f2fba44b3d1d7a2 /examples/18.src | |
| parent | Evaluator: Remove evaluator (diff) | |
| download | pry-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.src | 10 |
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; }; |