title: Dynamically inserting strings to a std::map
body: <p>I am trying to create a map of file pairs... First I am searching a specified directory for files using the FindFirstFile and FindNextFile and when a file is found I search the map to see if the associated file is there. If the other file was added to the map, the new found file is inserted beside the previously found one. If an associated file was not found, the new file is inserted to the map and its pair is left intact.</p>
  
  <p>To explain more:
  lets say we have 2 files file.1.a and file.1
  those files represent a pair and thus should be added to the map as a pair</p>
  
  <pre><code>//map&lt;File w/o .a, File w .a&gt;
  std::map&lt;CString, CString&gt; g_map;
  
  int EnumerateFiles(LPCTSTR Dir)
  {
     //Search Files....
     //Found a File....(for ex: file.1)
     //Append .a to the string and search for it in the map
     BOOL bAdded = FALSE;
     for(std::map&lt;CString, CString&gt;::iterator itr = g_map.begin(); itr != g_map.end(); itr++)
        {
          if(StrCmp(tchAssocFile, itr-&gt;second) == 0)
           {
                  bAdded = TRUE;
                  //pair the string with the other one;
           }
  
        }
      if(!bAdded)
         //Add the new string to the map and leave its associate blank
  
  
     //Do the same in reverse if the associate was found first....
  }
  </code></pre>
  
  <p>I hope this was clear as I can't think of any other way to put it... sry.</p>
  
  <p>Can you please help in solving this issue...</p>
  
  <p>regards</p>