diff options
| author | Baitinq <[email protected]> | 2025-01-03 20:43:21 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-01-03 20:43:21 +0100 |
| commit | 2b7d5d1445bac6c73e70ea0b49e2ffb3a5ec91f6 (patch) | |
| tree | 8f70e05e98962c5d4d2961b4beec3a16a4d14e48 | |
| parent | Cleanup (diff) | |
| download | c-hashtable-2b7d5d1445bac6c73e70ea0b49e2ffb3a5ec91f6.tar.gz c-hashtable-2b7d5d1445bac6c73e70ea0b49e2ffb3a5ec91f6.tar.bz2 c-hashtable-2b7d5d1445bac6c73e70ea0b49e2ffb3a5ec91f6.zip | |
better example
| -rw-r--r-- | src/main.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index ba8d6b6..aa15631 100644 --- a/src/main.c +++ b/src/main.c @@ -33,6 +33,20 @@ int main(int argc, char** argv) { res = hashtable_get(ht, "b"); printf("Result: %s\n", res); + + struct test { + int value; + }; + + struct test example = { + .value = 7 + }; + + hashtable_put(ht, "b", (void*)&example); + + struct test* res2 = hashtable_get(ht, "b"); + + printf("Result: %d\n", res2->value); hashtable_deinit(&ht); |