holey-bytes/hblang/examples/pointers.hb

12 lines
119 B
Plaintext
Raw Normal View History

2024-05-12 04:52:58 -05:00
main := fn(): int {
a := 1;
b := &a;
2024-05-12 15:40:28 -05:00
modify(b);
2024-05-12 04:52:58 -05:00
return a - 2;
}
2024-05-12 15:40:28 -05:00
modify := fn(a: *int): void {
*a = 2;
return;
}