dynamic map insertion and lookup

This commit is contained in:
Ginger Bill
2017-02-06 20:23:51 +00:00
parent 9f2d9b596d
commit c126339090
5 changed files with 55 additions and 45 deletions

View File

@@ -11,11 +11,12 @@
main :: proc() {
Value :: type f32;
m: map[int]Value;
m: map[int]u32;
reserve(^m, 16);
defer free(m);
// m[123] = 345.0;
m[123] = 345;
fmt.println(m[123]);
if x, ok := m[123]; ok {
fmt.println(x);
}