Write a function f so that the code int p; int q; double a[] = ... a[q] = a[p]; q = p; ... a[q] = a[p]; q = p; can be abbreviated int p; int q; double a[] = ... f(a,&q,p); ... f(a,&q,p);