Is *ptr++ same as *(ptr + 1)? I have an array named arr. Than > int *ptr = arr; The array conatins simple arithmetic integers such as: arr[0] = 0, arr [1] = 1..
printf(" Initial value of *ptr %d \n",*ptr);
*ptr++;
printf(" value of *ptr after *ptr++ %d \n",*ptr);
*(ptr++);
printf(" value of *ptr after *(ptr++) %d \n",*ptr);
*(ptr+1);
printf(" value of *ptr after *(ptr+1) %d \n",*ptr);
*ptr+1;
printf(" value of *ptr after *ptr+1 %d \n",*ptr);
The output is:
0
1
2
2
2
Is not the last value supposed to be 3 and 4 ? Is not *ptr++ = *ptr+1 or = *(ptr+1)?
Please help. Learning C concepts.