Difference in i++ and ++i command

Thread Starter

joemmech

Joined Jan 22, 2010
32
I have a confusion between i++ and ++i command in the c++ program. What is the difference between i++ and ++i command and what is the best to use between the two commands?
 

hgmjr

Joined Jan 28, 2005
9,027
++i means that the variable i is incremented before it is used while i++ means the i is used and then incremented.

hgmjr
 
Top