diff options
| -rw-r--r-- | README.md | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -113,8 +113,8 @@ cstring_destroy(&lookup); ```
The predefined shorthand macro *declare_CHash_string()* defines a CHash container with a CString as key, however you may use it like:
```
-chash_si_put(&map, "mykey", 12);
-int x = chash_si_get(&map, "mykey")->value; // no allocation of string key happens here.
+chash_si_put(&map, "mykey", 12); // constructs a CString key from the char* internally.
+int x = chash_si_get(&map, "mykey")->value; // no allocation of string key happens here, which is good.
```
An alternative would be to use *char* * as key type, but you would have to manage the memory of the hash char* keys yourself.
Note that this customization is also available for **CVector**, but only affects the *find()* function currently. See *declare_CVector_string()*.
|
