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

Thread: std::map find

  1. #1
    Join Date
    May 2015
    Posts
    500

    std::map find

    Hello,

    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"] = "192.168.29.40.900;1"

    the key referes to ip address 10.3.1.4

    Now I have somewhere in the code:

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

    (gdb) p ipaddress
    $3 = "10.3.1.4"

    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 ?

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

  2. #2
    Join Date
    May 2015
    Posts
    500

    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..

    thanks,
    ~pdk

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

Featured