mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 08:02:32 +00:00
12 lines
200 B
Zig
12 lines
200 B
Zig
|
const Example = struct { x: u8, y: u8 };
|
||
|
|
||
|
pub fn main() u8 {
|
||
|
var example: Example = .{ .x = 5, .y = 10 };
|
||
|
|
||
|
example = .{ .x = 10, .y = 20 };
|
||
|
return example.y + example.x - 30;
|
||
|
}
|
||
|
|
||
|
// run
|
||
|
//
|