For those not familiar with C, I believe teh following should work:
//This is using the Exclusive Or(XOR) operator
unsigned flipBit ( unsigned x, unsigned bit )
{
return x ^ (1UL << bit);4.
}
1
Sigiloso
2 de ago. de 2012
Reposted as I left a 4. in there that should not be.
For those not familiar with C, I believe the following should work:
//This is using the Exclusive Or(XOR) operator
unsigned flipBit ( unsigned x, unsigned bit )
{
return x ^ (1UL << bit);
}
1
Sigiloso
11 de mar. de 2012
If you don't know how to do this, you didn't go to computer science 101 class.