Can some one properly explain difference between y = ++x and y = x++
If we expand the operators :-
a = x++ //since plus is after x so we get
a = x
x = x+1
while for :
a = ++x (since x is later we have to assign later)
x = x+1
a = x (where x is increment so tenchically
a=x+1)
Thứ Sáu, 8 tháng 6, 2018
Đăng ký:
Nhận xét (Atom)