What I want to do is:
change the array a[] = {1,2,3,4,5}
to a[] = {5,4,3,2,1}
by recursion
void reverse(int *a, int size){
if ( size == 0)
return;
int t = a[size-1];
a[size - 1] = *a;
*a = t;
reverse(a, size/2);
}
However, the above coding did not work
it only gave the result {5,3,2,4,1}
It seems that the pointer did not progress forward after I plus 1.
i.e. it can't move from a[0] to a[1] and so on...
Thanks for your help!