begin kvtable
This commit is contained in:
5 files changed
+132
No files matched your search
+21
@@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <kv.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
kv_t *table = kv_init(1024);
|
||||
printf("%p\n", table);
|
||||
printf("%ld\n", table->capacity);
|
||||
|
||||
kv_put(table, "hello", "world");
|
||||
kv_put(table, "hello", "people");
|
||||
kv_put(table, "goodbye", "world");
|
||||
|
||||
for (int i = 0; i < table->capacity; ++i)
|
||||
{
|
||||
if (table->entries[i].key)
|
||||
{
|
||||
printf("[%d] %s: %s\n", i, table->entries[i].key, table->entries[i].val);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user