Back to course

Standard Library: HashMap

Full Course: Zig Programming From Zero to Hero

HashMaps

std.AutoHashMap is the most common key-value store in Zig.

zig var map = std.AutoHashMap(i32, []const u8).init(allocator); defer map.deinit();

try map.put(1, "One"); const val = map.get(1);