title: c++ invalid vector t subscipt
body: <pre><code>void readGroups(ifstream &amp;filein) {
  vector&lt;string&gt; listOfStringTokens;
  string tmpLine = "";
  string tokens = "";
  
  string courseCode, groupCode, groupName;
  int minGroupSize = 0, maxGroupSize = 0;
  int counter = 0;
  while (filein.good()){
  
      getline(filein, tmpLine);
      istringstream iss(tmpLine);
  
      while (!iss.eof()){
          getline(iss, tokens, ';');
          listOfStringTokens.push_back(tokens);
      }
  }
  tmpLine = "";
  tokens = "";
  filein.close();
  
  for (unsigned i = 0; i&lt;listOfStringTokens.size(); i++){
      courseCode = listOfStringTokens.at(i);
      groupCode = listOfStringTokens.at(i+1);
      groupName = listOfStringTokens.at(i+2);
      minGroupSize = converter(listOfStringTokens.at(i+3), minGroupSize);
      maxGroupSize = converter(listOfStringTokens.at(i+4), maxGroupSize);
  
      cout &lt;&lt; courseCode &lt;&lt; "\t" &lt;&lt; groupCode &lt;&lt; "\t" &lt;&lt; groupName &lt;&lt; "\t"
           &lt;&lt; minGroupSize &lt;&lt; "\t" &lt;&lt; maxGroupSize &lt;&lt; "\t" &lt;&lt; endl;
      i += 4;
  }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>int converter(string a, int b) {
  stringstream convert;
  convert &lt;&lt; a;
  convert &gt;&gt; b;
  
  convert.str("");
  convert.clear();
  
  return b; 
  </code></pre>
  
  <p>}</p>
  
  <p>Hi everyone!</p>
  
  <p>It is almost the first time for me using vectors and now i get stuck with this. The source of my  problem is the increase of <code>unsigned i</code> variable in the <code>.at()</code> in the <code>for loop</code> as i brought it to light. However i must make it to get an appropriate output. So i need your help guys to make this code run perfect without modifie the structure of output.</p>
  
  <p>Here's the output how it looks like:</p>
  
  <pre><code>xxxxxxxxx    xxxxxxx    xxxxxxxxxxxxxxxxxxxx    xx    xx
  xxxxxxxxx    xxxxxxx    xxxxxxxxxxxxxxxxxxxx    xx    xx
  xxxxxxxxx    xxxxxxx    xxxxxxxxxxxxxxxxxxxx    x     xx
  invalid vector&lt;T&gt; subscript
  </code></pre>