increment and decrement on pointerThis tip submitted by RAJKUMAR on 2011-08-03 00:31:45. It has been viewed 8407 times.
Rating of 5.3 with 20 votes
suppose a=10 and *c is an int variable and int pointer respectively, then
This statement will increment the value of variable a which is pointed by *c.
On the other hand,
This statement will increment by address not by pointed value, performing pointer arithmetic. Of course both of these are just a general case of dereferencing a pointer, but it's important to know that the * "takes effect" before the ++ does!
Help your fellow programmers! Add a tip!