diff options
| author | Baitinq <[email protected]> | 2025-05-28 00:11:06 +0200 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-05-28 00:11:06 +0200 |
| commit | 48958afe4e187ce496d3445ee622ec3bc7bc8453 (patch) | |
| tree | bf6c0ead8240a27e150e9e81dd9207cee4dbe211 /examples | |
| parent | Feature: Finish adding struct support :^) (diff) | |
| download | interpreter-48958afe4e187ce496d3445ee622ec3bc7bc8453.tar.gz interpreter-48958afe4e187ce496d3445ee622ec3bc7bc8453.tar.bz2 interpreter-48958afe4e187ce496d3445ee622ec3bc7bc8453.zip | |
Feature: Add sizeof builtin function
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/19.src | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/19.src b/examples/19.src index 5a3543f..2ae1973 100644 --- a/examples/19.src +++ b/examples/19.src @@ -3,7 +3,7 @@ extern malloc = (i64) => *void; extern free = (*void) => void; let main = () => i64 { - let buf = cast(*i8, malloc(13)); + let buf = cast(*i8, malloc(sizeof(i8) * 13)); (*(buf+cast(*i8, 0))) = 'h'; (*(buf+cast(*i8, 1))) = 'e'; (*(buf+cast(*i8, 2))) = 'l'; |