Hello all, is there simple way to check if a multimap contains a value, or am I going to have to loop through all pairs?
thanks
sciwizeh
62
Posting Pro in Training
Recommended Answers
Jump to PostIs this what you're looking for?
#include <iostream> #include <map> int main(int argc, char *argv[]) { std::multimap <int, double> MyMap; //create a mapping from "testone" to 111 MyMap.insert(std::pair<int, double>(1, 1.2)); //create an iterator std::map<int, double>::iterator iter; iter = MyMap.find(1); if(iter == MyMap.end()) { std::cout << "Not found." …
All 2 Replies
daviddoria
334
Posting Virtuoso
Featured Poster
sciwizeh
commented:
Just the info I needed
+2
sciwizeh
62
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.