title: How to change the order of elements in an array using a pointer?
body: <p>For example, I have an array:</p>
  
  <pre><code>int Arr[10]={1,2,3,4,5,6,7,8,9,10};
  </code></pre>
  
  <p>How to change its order of elements using a pointer to receive the following array:</p>
  
  <pre><code>Arr={10,9,8,7,6,5,4,3,2,1}
  
  to change the order odd and even using a pointer I've found this:
  But I need only to reverse an array (without replacing odd and even)
  #include &lt;iostream&gt;
  using namespace std;
  int main (const int&amp; Argc, const char* Argv[]){
  
  const int Nelem=10;
  int Arr[]={1,2,3,4,5,6,7,8,9,10};
  int *begAr=&amp;Arr[0];
  int *endAr=&amp;Arr[Nelem];
  int *itrAr=begAr;
  int *tmpValAr=new int(0);
  cout&lt;&lt;"Before\t1 2 3 4 5 6 7 8 9 10"&lt;&lt;endl;
  while(itrAr&lt;endAr){
  *tmpValAr=*itrAr;
  *itrAr=*(itrAr+1);
  *(itrAr+1)=*tmpValAr;
  itrAr+=2;
  }
  cout&lt;&lt;"After\t";
  for(int i=0; i&lt;Nelem; ++i)cout&lt;&lt;Arr[i]&lt;&lt;" ";
  cout&lt;&lt;endl;
  system("pause");
  return 0;
  }  
  </code></pre>