title: C++ Vectors: Why is this piece of code not working?
body: <pre><code>vector&lt; vector&lt; vector&lt;int&gt; &gt; &gt; myArray(5, vector&lt; vector&lt;int&gt; &gt;(4));
  vector&lt;int&gt; testArray();
  myArray[0][0].push_back(testArray);
  </code></pre>
  
  <p>I don't understand. I'm just trying to append a new element to it.</p>
  
  <p>Edit: Second line was wrong but this still doesn't compile.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  
  int main() {
      vector&lt; vector&lt; vector&lt;int&gt; &gt; &gt; myArray(5, vector&lt; vector&lt;int&gt; &gt;(4));
      vector&lt;int&gt; testArray;
      myArray[0][0].push_back(testArray);
      return 0;
  }
  </code></pre>
  
  <p>The compile error:</p>
  
  <p>pnt.cpp: In function ‘int main()’:
  pnt.cpp:8: error: no matching function for call to ‘std::vector >::push_back(std::vector >&amp;)’
  /usr/include/c++/4.4/bits/stl_vector.h:733: note: candidates are: void std::vector&lt;_Tp, _Alloc>::push_back(const _Tp&amp;) [with _Tp = int, _Alloc = std::allocator]</p>