BitTestAndClear
Returns the current value of the specified bit and then clears the bit (if the bit was not already cleared)
#include <nwbitops.h> LONG BitTestAndClear ( void *bitArray, LONG bitNumber);
This function returns an old bit value of 0 if the specified bit is cleared. Otherwise, it returns a value of 1.
The bitArray parameter specifies the target array. It can be byte-aligned and can point to an array of up to 2 32 - 1 bits.
#include <nwbitops.h> LONG oldBitValue; void *bitArray; LONG bitNumber; oldBitValue = BitTestAndClear (bitArray, bitNumber);