title: Appending array into vector
body: <p>I think it is a trivial question, but I couldn't find a specific solution to it. I'm trying to append array into a vector, using <code>push_back()</code> function. Here is the code:</p>
  
  <pre><code>int main()
  {
    std::vector&lt;int*&gt; matchVector;
  
    int msmTemp[3];
  
    msmTemp[0] = 1;
    msmTemp[1] = 2;
    msmTemp[2] = 3;
    matchVector.push_back(msmTemp);
    msmTemp[0] = 4;
    msmTemp[1] = 7;
    msmTemp[2] = 0;
    matchVector.push_back(msmTemp);
  
    for(auto i : matchVector)
    {
      for(int j = 0; j&lt;3; j++)
      {
        cout&lt;&lt;i[j]&lt;&lt;", ";
      }
      cout&lt;&lt;"\n";
    }
  
    return 0;
  }
  </code></pre>
  
  <p>The output I'm getting is 4,7,0 two times. I don't understand as to why I'm not able to see the previous values, namely 1,2,3? Is it because of the type of vector <code>matchVector</code> defined above? I think it needs to be array only.</p>