> What's the difference between a++ and ++a where a=1.?

What's the difference between a++ and ++a where a=1.?

Posted at: 2014-12-18 
a++ is post increment and ++a is pre increment.

int a = 1, b;

b = ++a; will assign the value 2 to b because a is incremented first.

a = 1;

b = a++; will assign the value 1 to b because a is incremented AFTER being assigned to b.

It's the same, but during execution ++a increments a to 2 immediately while a++ increments a to 2 only after the execution of the entire statement.