feat: add support for arrays
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
[code]
|
||||
fn swap(a: *i32, b: *i32) {
|
||||
let temp = *a;
|
||||
*a = *b;
|
||||
*b = temp;
|
||||
}
|
||||
|
||||
fn main() -> i32 {
|
||||
let a = [10, 20];
|
||||
swap(&a[0], &a[1]);
|
||||
return a[0] - a[1]; // 20 - 10 = 10
|
||||
}
|
||||
|
||||
[expected_return_code]
|
||||
10
|
||||
Reference in New Issue
Block a user