I have a DWORD variable and i want to know the value of the least significant bit and the one next to him .How can i acomplish this.
Thanks!
Printable View
I have a DWORD variable and i want to know the value of the least significant bit and the one next to him .How can i acomplish this.
Thanks!
Depending on whether the compiler decides to do any playing around with your endians (as it were)...Code:unsigned long x = 0xffffffff;
unsigned char y = x & 0x1;
// or (depends on architecture)
unsigned char y = x & 0x80000000;
[Edited by parksie on 11-20-2000 at 04:40 PM]
This ought to work, oughtn't it? (is that even a word?)
Code:y = your_variable;
y <<= 31;
y >>= 31;