Here is a recursive code using side effects in function argument.In K&R, i found a statement
saying C standard specifies that all side effects on arguments take effect before a function is called(page no.54 K&R second edition).But output to above code was contradictory.Could anyone help me out.
void reverse(int* array,int i,int j)
{
`int temp;
if(i>j)
return ;
else{
temp=array[i];
array[i]=array[j];
array[j]=temp;
//i++;
//j--;
reverse(array,i++,j--);
}
} '
PS:Output is segmentation fault
all side effects are completed, so the value of i and j is changed before function call.
but the value of express
i++andj--are still the value of i and j previously.