Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Robert Schaffenrath
703602-Compiler-Construction
Commits
0d1e01ab
Commit
0d1e01ab
authored
Jun 17, 2019
by
Alexander Hirsch
Browse files
Fix void main
parent
390a738f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
specification.md
specification.md
+4
-2
No files found.
specification.md
View file @
0d1e01ab
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment