Want my code to convert a matrix element to a vector row by row, it only show the last row of matrix to a vector
<pre><code>#include&lt;iostream.h&gt;

int main() {
  int i, j, matrix[2][3], vector[6];

  //filling the matrix with element
  for(i=0;i&lt;2;i++)
    for(j=0;j&lt;3;j++)
      cin &gt;&gt; matrix[i][j];
  for(i=0;i&lt;2;i++) {
    for(j=0;j&lt;3;j++)
      cout &lt;&lt; matrix[i][j];
    cout &lt;&lt; endl;
  }
  //filling the vector with matrix elements
  for(i=0;i&lt;2;i++) {
    for(j=0;j&lt;3;j++)
      vector[j] = matrix[i][j];
  }
  //show the vector
  for(j=0;j&lt;6;j++) {
    cout &lt;&lt; vector[j];
  }
  return 0;
}
</code></pre>
