master
1const std = @import("std");
2
3const Foo = union {
4 float: f32,
5 int: u32,
6};
7
8pub fn main() void {
9 var f = Foo{ .int = 42 };
10 bar(&f);
11}
12
13fn bar(f: *Foo) void {
14 f.* = Foo{ .float = 12.34 };
15 std.debug.print("value: {}\n", .{f.float});
16}
17
18// exe=succeed