Skip to content
MapFindFirstForKey

MapFindFirstForKey

MapFindFirstForKey

Description

Find the first value stored for a key as a cursor.

Parameters

Name Direction Description
m in Map.
key in Key to search for.

Success

Cursor positioned at the first value stored for the key.

Failure

MapValueCursorInvalid() if the key does not exist.

Usage example (Cross-references)

Usage examples (Cross-references)
        MapInsertR(&map, 9, 90);
    
        cursor = MapFindFirstForKey(&map, 4);
        while (MapValueCursorIsValid(cursor)) {
            int *value_ptr = MapValuePtrFromCursor(&map, cursor);
    
        bool result = (seen == 3) && (value_sum == (40 + 41 + 42));
        result      = result && !MapValueCursorIsValid(MapFindFirstForKey(&map, 99));
        result      = result && (MapValuePtrFromCursor(&map, MapValueCursorInvalid()) == NULL);
Last updated on