int swapElements(int a[], int i, int j) { int tmp; tmp = a[i]; a[i] = a[j]; a[j] = tmp; }
The compiler decides to generate code something like this with 4 assignments instead of 3:
int tmp1, tmp2; tmp1 = a[i]; tmp2 = a[j]; a[i] = tmp2; a[j] = tmp1;
int swapElements(int a[], int i, int j) { int tmp; tmp = a[i]; a[i] = a[j]; a[j] = tmp; }
The compiler decides to generate code something like this with 4 assignments instead of 3:
int tmp1, tmp2; tmp1 = a[i]; tmp2 = a[j]; a[i] = tmp2; a[j] = tmp1;