MapTryGetPtr
MapTryGetPtr
Description
Try to get pointer to the first value stored for a key.
This is an alias for MapGetFirstPtr with a more stdlib-style lookup name.
Parameters
| Name | Direction | Description |
|---|---|---|
m |
in,out | Map. |
key |
in | Key to search for. |
Success
Pointer to the first value stored for the key.
Failure
NULL
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Map.Access.c:65:
MapInsertR(&map, 11, 111);
int *value = MapTryGetPtr(&map, 11);
bool result = value && (*value == 110);
result = result && (MapTryGetPtr(&map, 999) == NULL);- In
Map.Access.c:67:
int *value = MapTryGetPtr(&map, 11);
bool result = value && (*value == 110);
result = result && (MapTryGetPtr(&map, 999) == NULL);
MapDeinit(&map);
Last updated on