Answer:
void swapAll(int *a1, int *a2, int n){
int i;
int tmp[n];
for(i = 0; i < n; i++){
tmp[i] = a1[i];
a1[i] = a2[i];
a2[i] = tmp[i];
}
}
Step-by-step explanation:
You just need a temporary structure.
I am going to write a c script, in which a1 and a2 are the arrays and n is the length of the arrays.
void swapAll(int *a1, int *a2, int n){
int i;
int tmp[n];
for(i = 0; i < n; i++){
tmp[i] = a1[i];
a1[i] = a2[i];
a2[i] = tmp[i];
}
}