title: Copying one int array to another C++
body: <p>Was trying to write a program which converts the value`s from one assigned array to another unassigned one. The code i wrote:</p>
  
  <pre><code>#include "stdafx.h";
  #include &lt;iostream&gt;;
  
  using namespace std;
  
  int a[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  int j[10];
  
  int copy_array(int *p1, int n);
  int *p2, *p2;
  
  int main() {
  
      for (int l = 0; l &lt; 10; l++) {
          cout &lt;&lt; a[l] &lt;&lt; endl;
      }
  
      copy_array(a, 10);
  
      for (int i = 0; i &lt; 10; i++) {
          j[i] = &amp;p2;
          cout &lt;&lt; j[i] &lt;&lt; endl;
      }
  
      system("PAUSE");
      return 0;
  }
  
  int copy_array(int *p1, int n) {
      while (n-- &gt; 0) {
          *p1 = *p2;
              *p1++;
          *p2++;
      }
  }
  </code></pre>
  
  <p>Im using the Microsoft visual studio platform and the error i got was "There is no context in which this conversion is possible". Why i cant use this int convert path? how can i fix and connect the 2 arrays using int type conversion(if its possible)?</p>
  
  <p>What i tried was manipulating the local function copy_array so it makes the conversion using the addresses of the j[10] array integers, but this gave me another error. Any support and advice would be appreciated.</p>