문제

How would I find the number of keys occurring between two key values in a map ? Is there any way to accomplish this using iterators?

도움이 되었습니까?

해결책

Have a look at map and some STL algirhtims:

http://www.cplusplus.com/reference/stl/map/
    lower_bound Return iterator to lower bound (public member function)
    upper_bound Return iterator to upper bound (public member function) 
    distance Calculates the number of elements between first and last.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top