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 RepliesReply to this topic
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.