CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: std::map find

  1. #1
    Join Date
    May 2015

    std::map find


    The following map

    map<string, string> CCF::m_mPDN2GxSessionId;

    It got populated with

    p CCF::m_mPDN2GxSessionId
    $6 = std::map with 1 elements = {
    ["(4) 0a 03 01 04"] = ";1"

    the key referes to ip address

    Now I have somewhere in the code:

    map<string, string>::iterator it = CCF::m_mPDN2GxSessionId.find(ipaddress);

    (gdb) p ipaddress
    $3 = ""

    But somehow the iterator is pointing to end of map i.e it is not able to find this ipaddress ?

    Not sure what I am doing wrong ?

    Last edited by pdk5; September 7th, 2015 at 02:44 PM.

  2. #2
    Join Date
    May 2015

    Re: std::map find

    Sorry this was mistake on my part. There are different ways to store ipaddresses in our legacy code and since the format was different, the map find was not able to find the key.

    Sorry for this confusion. Hope you forgive for my basic c++ questions..


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width