Add pass_array example
This commit is contained in:
parent
de49abc455
commit
8eaf560d0c
17
examples/pass_array/pass_array.mc
Normal file
17
examples/pass_array/pass_array.mc
Normal file
@ -0,0 +1,17 @@
|
||||
void foo(int[10] array)
|
||||
{
|
||||
array[5] = 42;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int[10] array;
|
||||
array[5] = 23;
|
||||
|
||||
foo(array);
|
||||
|
||||
print_int(array[5]);
|
||||
print_nl();
|
||||
|
||||
return 0;
|
||||
}
|
0
examples/pass_array/pass_array.stdin.txt
Normal file
0
examples/pass_array/pass_array.stdin.txt
Normal file
1
examples/pass_array/pass_array.stdout.txt
Normal file
1
examples/pass_array/pass_array.stdout.txt
Normal file
@ -0,0 +1 @@
|
||||
42
|
Loading…
Reference in New Issue
Block a user