Question
Hello all, what is the difference between *grade++ *(grade++) (*grade)++ ++*grade *++grade *(++grade) please with examples... I didn't understand manipulationgpointers very well help asap Hello all, what is the difference between *grade++ *(grade++) (*grade)++ ++*grade *++grade *(++grade) please with examples... I didn't understand manipulationgpointers very well help asap *(grade++) (*grade)++ ++*grade *++grade *(++grade) please with examples... I didn't understand manipulationgpointers very well help asap (*grade)++ ++*grade *++grade *(++grade) please with examples... I didn't understand manipulationgpointers very well help asap
Explanation / Answer
*grade++ // will increment the value present in the gradevariable by one suppose total=10, andgrade=&total, then this statment will made change the value of totaland it will now 11. *(grade++) // address which is present in thegrade will be incremented and then value at that address ispointed. suppose total=100, and address of total is stored ingrade=&total (suppose this address is 0x002), after theexecution of this statement address will be 0x003. (*grade)++ // value is get and then incremented (post increment) ++*grade // value is get and then incremented (pre increment) *++grade //I think this is error... *(++grade) value of grade is incremented and then value present at thataddress is retrieved. *(grade++) // address which is present in thegrade will be incremented and then value at that address ispointed. suppose total=100, and address of total is stored ingrade=&total (suppose this address is 0x002), after theexecution of this statement address will be 0x003. (*grade)++ // value is get and then incremented (post increment) ++*grade // value is get and then incremented (pre increment) *++grade //I think this is error... *(++grade) value of grade is incremented and then value present at thataddress is retrieved. (*grade)++ // value is get and then incremented (post increment) ++*grade // value is get and then incremented (pre increment) *++grade //I think this is error... *(++grade) value of grade is incremented and then value present at thataddress is retrieved.