Discussion board
What is the difference between pre increment and post increment operators?
By Abhijit Paul
Difference between pre increment and post increment operator...
Reply
Post   Reset
Teacher SiliconIndia replied to Abhijit Paul Wednesday, March 17, 2010
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
}
}