Forum : What is the difference between pre increment and post increment operators?
Brief description  about Online courses   join in Online courses
View Abhijit  Paul 's Profile

What is the difference between pre increment and post increment operators?

Difference between pre increment and post increment operator...
Asked by Abhijit Paul | Mar 17, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Abhijit,
Pre increment means that if you have for instance a loop:
{



for (int i = 1; i<10; i++)
{

the index i before the first iteration equals 1


the index i after the first iteration equals 2

}
}

Post increment
{


for (int i = 1; i<10; i++)
{

the index i after before the iteration equals 2


the index i after the first iteration equals 3
}
}
Mar 17, 2010