If I have a byte variable: byte b = 0;
why does the following work:
b++;
b += 1; // compiles
... but this does not ?
b = b + 1; // compile error
Does compiler understand first as byte
and second as int
?
[EDIT]
I know casting but I want to draw your attention to the b++, b += 1 and b = b + 1
I think they are equal so why compiler differs them ? what is the difference between
b += 1 and b = b + 1 ?