zig/doc/langref/anonymous_struct_name.zig

17 lines
205 B
Zig

const Node = struct {
next: ?*Node,
name: []const u8,
};
var node_a = Node{
.next = null,
.name = "Node A",
};
var node_b = Node{
.next = &node_a,
.name = "Node B",
};
// syntax