stdext::hash_map question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jacky Luk
    New Member
    • Aug 2010
    • 6

    #1

    stdext::hash_map question

    Could anyone explain why this code doesn't crash,
    http://www.codeguru.co m/forum/showthread.php? t=315286
    while mine does,

    Code:
    typedef stdext::hash_map<int, bool> pf_type;
    pf_type pf;
    
    
    cAStar::cAStar()
    {
      char buff[256];
      pf[1] = false;
      sprintf (buff, "pf[1] is %s\n", pf[1] ? "TRUE" : "FALSE");
      OutputDebugString(buff);
    }


    The error was "Vector subscript out of range"
    if memory needs to be reserved, there is no point to use it?!


    Thanks a lot :)
    Jack
Working...