diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-01-29 20:15:16 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-01-29 20:15:16 +0000 |
| commit | 984e36a15147cb4ed681174fb1f97f4e1735411d (patch) | |
| tree | 042890f3eb8a56add6091646279a599204635d18 /code | |
| parent | ec9c8fb8a49cb6f9fe8f6df806dfb5a6fcb2e148 (diff) | |
Dynamic arrays
Diffstat (limited to 'code')
| -rw-r--r-- | code/demo.odin | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/code/demo.odin b/code/demo.odin index 4198cffb6..32ff09d33 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -10,8 +10,19 @@ // #import win32 "sys/windows.odin"; main :: proc() { - // syntax(); - procedure_overloading(); + array: [dynamic]int; + defer free(array); + reserve(^array, 10); + + append(^array, 2); + append(^array, 3); + append(^array, 5); + append(^array, 7); + append(^array, 11); + append(^array, 13); + for val, idx in array { + fmt.println(val, idx); + } } syntax :: proc() { |