Click here to Skip to main content
15,913,722 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: problems in dynamic Memory allocation Pin
James R. Twine9-Jun-05 4:38
James R. Twine9-Jun-05 4:38 
GeneralRe: problems in dynamic Memory allocation Pin
Amit Mulay9-Jun-05 2:12
Amit Mulay9-Jun-05 2:12 
GeneralRe: problems in dynamic Memory allocation Pin
James R. Twine9-Jun-05 4:25
James R. Twine9-Jun-05 4:25 
GeneralRe: problems in dynamic Memory allocation Pin
Tim Smith9-Jun-05 3:50
Tim Smith9-Jun-05 3:50 
GeneralRe: problems in dynamic Memory allocation Pin
James R. Twine9-Jun-05 4:26
James R. Twine9-Jun-05 4:26 
GeneralRe: problems in dynamic Memory allocation Pin
Alexander M.,9-Jun-05 5:46
Alexander M.,9-Jun-05 5:46 
GeneralRe: problems in dynamic Memory allocation Pin
James R. Twine9-Jun-05 5:56
James R. Twine9-Jun-05 5:56 
Generalstd::map problem Pin
Bob Stanneveld8-Jun-05 23:34
Bob Stanneveld8-Jun-05 23:34 
Hello,

I was wondering, is there a way to retrieve the key associated with a value when you have only the iterator?

Lets take the following code example:
// we have the map
typedef std::map<int, std::string> MyMap;

MyMap map;
// insert some values

// in some other function
for( MyMap::iterator iter = map.begin();
     iter !< map.end(); 
     iter++;
{
    // get the key from the map using the iterator...
    // do something with the key and the value...
}


Is this possible and if yes, how can I achieve this?

Behind every great black man...
            ... is the police. - Conspiracy brother


Blog[^]
GeneralDoh! Pin
Bob Stanneveld9-Jun-05 0:20
Bob Stanneveld9-Jun-05 0:20 
GeneralRe: std::map problem Pin
Nilesh K.9-Jun-05 0:21
Nilesh K.9-Jun-05 0:21 
GeneralRe: std::map problem Pin
Bob Stanneveld9-Jun-05 0:26
Bob Stanneveld9-Jun-05 0:26 
GeneralRe: std::map problem Pin
grasstafari9-Jun-05 0:25
grasstafari9-Jun-05 0:25 
GeneralPOST string to .asp Pin
dex_ter118-Jun-05 23:24
dex_ter118-Jun-05 23:24 
GeneralRe: POST string to .asp Pin
Bob Stanneveld8-Jun-05 23:54
Bob Stanneveld8-Jun-05 23:54 
GeneralRe: POST string to .asp Pin
ThatsAlok9-Jun-05 1:05
ThatsAlok9-Jun-05 1:05 
GeneralRe: POST string to .asp Pin
dex_ter119-Jun-05 15:16
dex_ter119-Jun-05 15:16 
GeneralRe: POST string to .asp Pin
ThatsAlok9-Jun-05 18:21
ThatsAlok9-Jun-05 18:21 
GeneralLNK2001 Error Using Edit Control Variable in static function Pin
CNewbie8-Jun-05 23:03
CNewbie8-Jun-05 23:03 
GeneralRe: LNK2001 Error Using Edit Control Variable in static function Pin
GDavy8-Jun-05 23:19
GDavy8-Jun-05 23:19 
GeneralRe: LNK2001 Error Using Edit Control Variable in static function Pin
Bob Stanneveld9-Jun-05 0:03
Bob Stanneveld9-Jun-05 0:03 
GeneralRe: LNK2001 Error Using Edit Control Variable in static function Pin
CNewbie9-Jun-05 0:45
CNewbie9-Jun-05 0:45 
GeneralRe: LNK2001 Error Using Edit Control Variable in static function Pin
Bob Stanneveld9-Jun-05 1:12
Bob Stanneveld9-Jun-05 1:12 
GeneralRe: LNK2001 Error Using Edit Control Variable in static function Pin
CNewbie9-Jun-05 1:19
CNewbie9-Jun-05 1:19 
GeneralRe: LNK2001 Error Using Edit Control Variable in static function Pin
Bob Stanneveld9-Jun-05 1:29
Bob Stanneveld9-Jun-05 1:29 
GeneralRe: LNK2001 Error Using Edit Control Variable in static function Pin
CNewbie9-Jun-05 1:23
CNewbie9-Jun-05 1:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.