diff options
| author | Tyge Løvset <[email protected]> | 2020-03-05 09:44:46 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-03-05 09:44:46 +0100 |
| commit | a35d39a0e919124c62529d14fb570e1c210806ac (patch) | |
| tree | bc9a2cf49fb2dfd2385d527de79ac647d7ae0efe | |
| parent | 20509b538a9a43555e9a30818dfaf5d268c0107c (diff) | |
| download | STC-modified-a35d39a0e919124c62529d14fb570e1c210806ac.tar.gz STC-modified-a35d39a0e919124c62529d14fb570e1c210806ac.zip | |
Minor bug in description
| -rw-r--r-- | README.md | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -28,7 +28,7 @@ for (int i = 0; i < cvector_size(bignums); ++i) value = bignums.data[i]; cvector_ix_destroy(&bignums); ``` -CVector of CString +CVector of CString: ``` #include "cstring.h" #include "cvector.h" @@ -40,7 +40,7 @@ cvector_cs_push(&names, cstring_make("Joe")); printf("%s\n", names.data[1].str); // Access the string char* cvector_cs_destroy(&names); ``` -Simple CMap, int -> int. +Simple CMap, int -> int: ``` #include "cmap.h" declare_CMap(ii, int, int); @@ -62,10 +62,10 @@ cmap_si_put(&nums, "Hello", 64); cmap_si_put(&nums, "Groovy", 121); cmap_si_put(&nums, "Groovy", 200); // overwrite previous // iterate the map: -for (cmap_si_iter_t i = cmap_si_begin(nums); i.item != cmap_si_end(nums); i = cmap_si_next(i)) +for (cmap_si_iter_t i = cmap_si_begin(nums); i.item != cmap_si_end(nums).item; i = cmap_si_next(i)) printf("%s: %d\n", i.item->key.str, i.item->value); -// or use the short form: +// or rather use the short form: cforeach (i, cmap_si, nums) printf("%s: %d\n", i.item->key.str, i.item->value); |
