Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

STL map class

Status
Not open for further replies.

raochetan

Programmer
Aug 20, 2001
62
IN
Hi Everybody,

How can i check, if a given key exists in the map? I want to process the values of the key if it exists otherwise insert the key in the map.


Thanks in advance.

raochetan
 
use find
theIterator = theMap.find(theKey);
if(theIterator == theMap.end()){
// do your insertion here
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top