add sources
This commit is contained in:
parent
fcd25eea52
commit
7ce631a648
21 changed files with 548 additions and 2 deletions
|
@ -0,0 +1,26 @@
|
|||
void fun(int x)
|
||||
{
|
||||
x += 42;
|
||||
}
|
||||
|
||||
void gun(int[] x)
|
||||
{
|
||||
x = [ 1, 2, 3 ];
|
||||
}
|
||||
|
||||
void hun(int[] x)
|
||||
{
|
||||
x[0] = x[1];
|
||||
}
|
||||
|
||||
unittest
|
||||
{
|
||||
int x = 10;
|
||||
fun(x);
|
||||
assert(x == 10); // Ничего не изменилось
|
||||
int[] y = [ 10, 20, 30 ];
|
||||
gun(y);
|
||||
assert(y == [ 10, 20, 30 ]); // Ничего не изменилось
|
||||
hun(y);
|
||||
assert(y == [ 20, 20, 30 ]); // Изменилось!
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue