Files
2026-04-23 00:19:11 +02:00

15 lines
218 B
Plaintext

[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