rust question
struct Point { | |
x: int, | |
y: int | |
} | |
fn one() { | |
let mut a = ~Point{x: 10, y: 20}; | |
a.x = 42; | |
println(a.x.to_str()); | |
} | |
fn two() { | |
let a = @mut Point{x: 10, y: 20}; | |
a.x = 42; | |
println(a.x.to_str()); | |
} | |
fn main() { | |
one(); | |
two(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment