0
i have read lots of stuff about ++x(pre) and x++(post) increments n decrements i need a totally simple explanation about that
cpp
2 Answers
+ 1
++x means increment and then return
x++ means return and then increment
Example:
int x = 0;
int y = 0;
cout<<x++ //prints 0 because x was returned before incrementing it
cout<<++y //prints 1 because y was incremented before returning it