diff options
| author | Tyge Løvset <[email protected]> | 2020-06-22 19:48:56 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-06-22 19:48:56 +0200 |
| commit | 12ac034497529e5921b0dd612e10d4166b17db9a (patch) | |
| tree | afb6d5b4c7c446fd4ec12f300e09f175b6c7b6f1 | |
| parent | 63a2b98e433edacdd92eec87c2af5b569acd25bb (diff) | |
| download | STC-modified-12ac034497529e5921b0dd612e10d4166b17db9a.tar.gz STC-modified-12ac034497529e5921b0dd612e10d4166b17db9a.zip | |
Update README.md
| -rw-r--r-- | README.md | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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).
|
