Helper function to set the state of a single bit in a byte-buffer.
SetBit( buffer, bitno, value )
Set the state of a single bit in a buffer
buf | Reference to the byte buffer |
bitno | The bit number (0-indexed) |
value | 0 or 1 (any non-zero value is considered =1) |
Returns the state of the bit (1 or 0) before it was set.
new buffer{80}; SetBit(buffer, 18, 1);