title: How to search for common elements in 2 arrays of a vector which is a key in a map?
body: <p>I have a map which takes in a <code>vector&lt;int&gt;</code> of size 3 as the key and a string as value. This map contains about 2000 entries which are parsed from a file. I need to check if each element in vector 1 is present in vector 2.</p>
  
  <pre><code>int index;
  map&lt;vector&lt;int&gt;,string&gt;::iterator i2;
  
  for ( i2=my_map.begin() ; i2 != my_map.end(); i2++)
  {
      int id_cnt = (*i2).first.at(0);
      int prev_cnt = (*i2).first.at(1);
  
      for (index=0; index &lt; my_map.size(); index++)
      {
          if (prev_cnt==id_cnt[index])                     //error
          {
              //code to do something
          }
      }
  
      cout &lt;&lt; "hi" &lt;&lt;endl;
      cout &lt;&lt; (*i2).second &lt;&lt; endl;
  }
  </code></pre>
  
  <p>The error i get is: </p>
  
  <blockquote>
    <p>"Susbscripted value is not an array, pointer or vector.</p>
  </blockquote>
  
  <p>I've been working on C++ only since a week and I don't understand anything! :(</p>
  
  <p>Edit:</p>
  
  <p>I have 4 columns:</p>
  
  <pre><code>4 6 65 gdsg
  6 1 64 sggg
  1 2 34 wetw
  7 4 25 wtwt
  8 5 25 heyq
  5 7 23 fheh
  2 5 12 fetd
  </code></pre>
  
  <p>I have to check if each number from the 1st column is present in column 2. So, in the case of the 1st element of column 1: 4 is present in column 2. Now I take the corresponding 3rd column number (25) and place it in a vector of 26 alphabets under the 20th element. 20th because I need to get the last character of the corresponding string (wtwt). T is the 20th letter.</p>
  
  <p>I have to do this process for elements in column 1.</p>