Can anyone explain the difference between * ptr++ and ++ *ptr ?
To my understanding, * ptr++ increments the pointer and not the value pointed by it and ++ *ptr increments the value being pointed by it. Does the former mean incrementing the address of the pointer ? Please explain.
Thanks & Regards,
Jump to Post
Start by writing a piece of code with two pointers and known contents.
Output the value of the pointers and the data that they point to.
Now, do both increments on the two pointers.
Next, output the value of the pointers and the data that they point to again.
All 2 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.