edlang/lib/edlang_driver/tests/programs/struct.ed
2024-05-07 09:11:44 +02:00

19 lines
215 B
Rust

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