Get lower_bound from a multiset in index mode 0

0

Here's the code:

first = mult.lower_bound(c);
        last = mult.upper_bound(c);
        if (first == mult.end())
        {
            printf("%d not found\n", c);
        }
        else
        {
            printf("%d found from %d to %d\n", c, first, last);
        }

The problem is that the first and last are iterators, I've tried first - mult.begin () but the IDE does not accept: /

    
asked by anonymous 31.07.2016 / 10:31

1 answer

0

Solved, I used a distance(mult.begin(), first) and also last: D

    
31.07.2016 / 10:50