+ 1
Someone explane what is --x?
6 Réponses
+ 4
b will equal -2
+ 3
Decreases x by 1 and returns the new value.
0
It's means the original value the at has been initialized - 1 e.g x = 2, - - x = x - 1
0
thanks
0
Consider the following example code:
int x = 0;
int a = x--;
int b = --x;
"a" would equal 0 since the decrement occurs AFTER the assignment.
"b" would equal -1 since the decrement occurs BEFORE the assignment.