From 5a1f68a1aa1d561324b12131dcb0b9bc76c350ab Mon Sep 17 00:00:00 2001 From: tidwall Date: Tue, 22 Mar 2022 10:45:48 -0700 Subject: [PATCH] Add hashmap_iter example --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 78cd474..c61403e 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ int main() { printf("\n-- iterate over all users (hashmap_scan) --\n"); hashmap_scan(map, user_iter, NULL); + printf("\n-- iterate over all users (hashmap_iter) --\n"); size_t iter = 0; void *item; while (hashmap_iter(map, &iter, &item)) { @@ -92,6 +93,12 @@ int main() { // Dale (age=44) // Roger (age=68) // Jane (age=47) +// +// -- iterate over all users (hashmap_iter) -- +// Dale (age=44) +// Roger (age=68) +// Jane (age=47) + ``` ## Functions