The problem is that 2 gets interpreted as integer, then the inverted value is negative and can not be assigned to an unsigned variable. The operation ~2 happens in the compiler itself.
You can change that behaviour when you write the number 2 to 'a' and then do a '~' operation:
Code: Select all
a.a = 2
a = ~a
c.c = 2
c = ~c
u.u = 2
u = ~u
Debug a
Debug c
Debug u
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.