*(ptr)++ is no different from *ptr++
The postfix and prefix operators always follow four steps.
- Make a copy of the variable
- Increment the copy of the variable
- Assign the incremented copy back to the original variable
- Prefix ++x returns the incremented variable, Postfix x++ returns the unincremented variable.
#include <stdio.h>
int main(void) {
char *ptr = "gateforum";
*ptr++; //ptr is incremented but while derefrencing non-incremented address is returned
ptr++; //ptr is incremented and now pointing "t" in "gateforum"
printf("%s",ptr++); //ptr is incremented but "teforum" is printed
return 0;
}
https://denniskubes.com/2012/08/14/do-you-know-what-p-does-in-c/