This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Exactly when we use pre and post increment..??
I know the working of pre and post increment perfectly
But i want to know what exactly is the difference between them in terms of using them.
i mean when we use pre increment and when we use post increment
i googled it out but didnt got satisfactory answer( may be it was not of my understanding level answers).
This is right place where i can get my answer surly .
Please tell me .
Here's my strategy for when to use those two similar-looking features:
I don't ever use them in a place where I do anything with the result of the incrementation (is that the word?). And that means that they are interchangeable. Both of them increment the variable they are applied to, but I don't have to know which of them does what after that.
I would recommend you do that too. Sure, for the certification exam you have to know which is which, but in the real world of programming it's much easier to do it my way.