zig/test/cases/structs.3.zig

14 lines
257 B
Zig
Raw Normal View History

2022-04-27 21:59:55 +01:00
const Example = struct { x: u8, y: u8 };
pub fn main() u8 {
var example: Example = .{ .x = 5, .y = 10 };
var example2: Example = .{ .x = 10, .y = 20 };
_ = &example2;
2022-04-27 21:59:55 +01:00
example = example2;
return example.y + example.x - 30;
}
// run
//