edlang/lib/edlang_driver/tests/programs/struct.ed
2024-03-13 12:24:40 +01:00

19 lines
211 B
Rust

struct Hello {
a: i32,
b: i64,
}
pub fn main() -> i64 {
let x: Hello = Hello {
a: 2,
b: 3,
};
hello(&mut x);
return x.b;
}
pub fn hello(a: &mut Hello) {
a.b = 5;
}