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