From 0d1e01abe1ad7595ef18c116a44bac3844836c3c Mon Sep 17 00:00:00 2001 From: Alex Hirsch Date: Mon, 17 Jun 2019 09:58:36 +0200 Subject: [PATCH] Fix void main --- specification.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/specification.md b/specification.md index a5098f7..fd62393 100644 --- a/specification.md +++ b/specification.md @@ -229,10 +229,11 @@ Modifications made to an array inside a function are visible outside the functio arr[2] = 42; } - void main() { + int main() { int[5] arr; foo(arr); print_int(arr[2]); // outputs 42 + return 0; } While strings can be re-assigned (in contrast to arrays), this is not visible outside the function call. @@ -241,11 +242,12 @@ While strings can be re-assigned (in contrast to arrays), this is not visible ou s = "foo"; } - void main() { + int main() { string s; s = "bar"; foo(s); print(s); // outputs bar + return 0; } #### Type Conversion