0
Can you explain. ...++a. Or --a ?
2 Respostas
+ 1
Hello
++ or -- are unary increment or decrement operators.
Now,
when you write say
a++; it is Post increment
and
++a; it is Pre increment
now lets take a variable say i
int i;
if you write
a = 5;
i = a++;
then the value of i will be 5.
and value of a will be incremented after Semi Colon.
but it you write
a = 5;
i = ++a;
then the value of i will be 6, as a is incremented first and then value is assigned to the variable i.
0
++a is upcreased nuber for one,--a is decreased nuber for one.
for exapmle ++5 is 6 but --5 is 4...