improve addressof
This commit is contained in:
@@ -5,15 +5,19 @@ struct Human {
|
||||
}
|
||||
|
||||
export func main(args: []^string): i64 {
|
||||
let x = [3]f64
|
||||
let age: u64 = 23
|
||||
|
||||
x[0] = 1
|
||||
x[1] = 2
|
||||
x[2] = 3
|
||||
let me = alloc Human {
|
||||
age = &age
|
||||
}
|
||||
|
||||
c::printf("%f\n", x[0])
|
||||
c::printf("%f\n", x[1])
|
||||
c::printf("%f\n", x[2])
|
||||
me.age^ = 24.5
|
||||
|
||||
test(me.age^)
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
func test(me: u64) {
|
||||
c::printf("%d\n", me)
|
||||
}
|
||||
Reference in New Issue
Block a user