Thứ Sáu, 8 tháng 6, 2018

difference between y = ++x and y = x++

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)

Không có nhận xét nào:

Đăng nhận xét