title: C++ input loop gives "Process finished with exit code 11" Error
body: <p>The following is the start of my C++ code. I'd like to be able to type in 5 inputs and get them stored in the vector. However the code breaks on the double array element access. How can I fix this and why is it breaking? The error I'm getting on my IDE (CLion) is "could not find operator[]".</p>
  
  <pre><code>#include &lt;algorithm&gt;
  #include &lt;iomanip&gt;
  #include &lt;ios&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  
  using std::cin;
  using std::cout;
  using std::endl;
  using std::setprecision;
  
  using std::sort;
  using std::streamsize;
  using std::string;
  using std::vector;
  
  int main () {
      vector&lt;int&gt; inputVec;
      int x;
      while (cin &gt;&gt; x &amp;&amp; inputVec.size() &lt; 5) {
          inputVec.push_back(x);
          cout &lt;&lt; inputVec.size() &lt;&lt; endl;
      }
      sort(inputVec.begin(), inputVec.end());
      cout &lt;&lt; "before if 1" &lt;&lt; endl;
      typedef vector&lt;double&gt;::size_type vec_sz;
      vec_sz size = inputVec.size();
      cout &lt;&lt; "before if 3" &lt;&lt; endl;
      if (size &lt; 4) {
          cout &lt;&lt; "too few inputs";
      } else {
          cout &lt;&lt; "calculating quartiles" &lt;&lt; endl;
          int quartileSize = size / 4;
          int leftOvers = size - quartileSize * 4;
          int count = 0;
          vector&lt;vector&lt;int&gt;&gt; quartiles(4);
          for (int i = 0; i &lt; 3; i++) {
              for (int j = 0; i &lt; quartileSize; j++) {
                  quartiles[i][j] = inputVec[count++];
              }
          }
  </code></pre>