void f(double *a,int *qaddress,int p) { a[*qaddress] = a[p]; *qaddress = p; } /* Above this line is the solution. */ /* Below this line is a sample program that checks the solution. */ int main(void) { int p = 0; int q = 1; double a[] = { 3.14, 2.71 }; printf("a[0] is %lf, a[1] is %lf, p is %d, q is %d.\n",a[0],a[1],p,q); f(a,&q,p); printf("a[0] is %lf, a[1] is %lf, p is %d, q is %d.\n",a[0],a[1],p,q); return 0; }