badai

we are being told that if the operators has the same precedent, it will be evaluated from left to right.

let say:

a = 1;

b = 2;

c = 3;

now do this:

a = b = c

you will get a = 3 and b = 3.

by right it should be evaluated like this:

(a = b) = c

which a =b then b = c

why it is like this?

let say:

a = 1;

b = 2;

c = 3;

now do this:

a = b = c

you will get a = 3 and b = 3.

by right it should be evaluated like this:

(a = b) = c

which a =b then b = c

why it is like this?