Anyone noticed that...
C / C++ / MFC
5
Posts
3
Posters
0
Views
1
Watching
-
unsigned val = ~0 results in 11001100110011001100110011001 If val is an int it is of course 11111111111111111111111111111111, which you expect. But why does unsigned behave so strangely?
-
unsigned val = ~0 results in 11001100110011001100110011001 If val is an int it is of course 11111111111111111111111111111111, which you expect. But why does unsigned behave so strangely?
-
I have:
unsigned foo = ~0;
and the debugger shows:
foo = 0xffffffff
So, in answer to your question, "no, I haven't".