Earlier posts have described why array names cannot be incremented. But.. What about these two different ways of incrementing?
void f(int arr[]){
printf("%d\n",*arr++);
printf("%d\n",*arr);
}
int main(void){
int arr[3]={1,2,3};
f(arr);
// COMPILE BY COMMENTING THESE TWO LINES BELOW AND ADDING THEM
printf("%d\n",*arr++);
printf("%d\n",*arr);
}
I am not able to figure why it works in one case and not in the other. Any suggestions/guidance welcome.