 <p>try catching the array values in a reference:</p> <pre><code>MyClass &amp;* item1 = *pointerArray + i; MyClass &amp;* item2 = *pointerArray + i + 1; </code></pre> <p>then you shouldn't need to re-assign the values after the fact.</p> <p>EDIT: What you were doing is essentially making a copy to the pointers in item1, item2. Swapping them swapped the copies, but not the original. You could try omitting the copies and just doing something like this:</p> <pre><code>Swap(&amp;(*pointerArray + i), &amp;(*pointerArray + i + 1)); </code></pre>