mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-26 16:23:55 +00:00
dynamic map insertion and lookup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user