Seems I am having brain freeze. I can't figure out how to do this one.
Say I have an array of 8 unsigned chars
unsigned char buffer[8];
Which would make 64 bits in total.
Using C, how do I set the nth bit of the buffer to a given value (1 or 0)?
I'm guessing I would need to do an exclusive or but I am having a hard time figuring an efficient way to determine both bit and bit position.
Say I have an array of 8 unsigned chars
unsigned char buffer[8];
Which would make 64 bits in total.
Using C, how do I set the nth bit of the buffer to a given value (1 or 0)?
I'm guessing I would need to do an exclusive or but I am having a hard time figuring an efficient way to determine both bit and bit position.