title: Swap two arrays without completely allocating a third (C++)
body: <p>I have two arrays of type <code>Region</code>, both of size 1000, and at every iteration of a loop I want to swap the two of them (by swapping their memory addresses). I was hoping this would work:</p>
  
  <pre><code>        Region *swap = (Region*)myRegions;
          myRegionsLast = myRegions;
          myRegions = (Region[1000])swap;
  </code></pre>
  
  <p>Line one seems fine. The second and third lines are invalid assignments, as you apparently can't re-assign that type.  The third line is also invalid because you can't cast to the type <code>(Region [1000])</code>.  Obviously I don't want to allocate whole new Region[1000] if I can help it.  Can someone help me accomplish what I want?</p>