From 12ac034497529e5921b0dd612e10d4166b17db9a Mon Sep 17 00:00:00 2001 From: Tyge Løvset <60263450+tylov@users.noreply.github.com> Date: Mon, 22 Jun 2020 19:48:56 +0200 Subject: Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 360ce3e1..bab83512 100644 --- a/README.md +++ b/README.md @@ -109,10 +109,10 @@ CString lookup = cstring_make("mykey"); int x = chash_si_get(&map, lookup)->value; cstring_destroy(&lookup); ``` -The predefined shorthand macro *declare_CHash_string()* defines a CHash container with a CString as key, but you may use it like: +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 happening here. +int x = chash_si_get(&map, "mykey")->value; // no allocation of string key happens here. ``` An alternative would be to use *char* * as key type, but you would the need to manage memory of the hash string keys yourself. Note that this customization is also available for **CVector**, but only affects the *find()* function currently. See *declare_CVector_string()*. @@ -300,7 +300,7 @@ declare_CArray(f, float); int main() { - CArray3_f a3 = carray3f_make(30, 20, 10, 0.f); + CArray3_f a3 = carray3_f_make(30, 20, 10, 0.f); carray3_f_data(a3, 5, 4)[3] = 10.2f; // a3[5][4][3] CArray2_f a2 = carray3_f_at(a3, 5); // sub-array reference (no data copy). -- cgit v1.2.3