Swapping values using pointers
<p>I have this code fragment</p>

<pre><code>int i = 5;
int k = 7;
int * iPtr;
int * jPtr;
int * kPtr;

iPtr = &amp;i;
kPtr = &amp;k;
</code></pre>

<p>I am required to swap i and k using the pointers. This is how I'm doing it:</p>

<pre><code>*jPtr = *kPtr ;
*kPtr = *iPtr ;
*iPtr = *jPtr ;
</code></pre>

<p>Is this the best way to do it, or is there a better way?</p>
