BitTestAndClear

Returns the current value of the specified bit and then clears the bit (if the bit was not already cleared)

Local Servers:nonblocking
Remote Servers:N/A
Classification:3.x, 4.x, 5.x, 6.x
Service:Bit Array

Syntax

  #include <nwbitops.h>  
   
  LONG BitTestAndClear  (  
     void   *bitArray,   
     LONG    bitNumber); 
  

Parameters

bitArray
(IN) Points to the bit array.
bitNumber
(IN) Specifies an index into the bit array.

Return Values

This function returns an old bit value of 0 if the specified bit is cleared. Otherwise, it returns a value of 1.

Remarks

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.

See Also

BitTestAndSet

Example

  #include <nwbitops.h>  
  LONG    oldBitValue;  
  void   *bitArray;  
  LONG    bitNumber;  
  oldBitValue = BitTestAndClear (bitArray, bitNumber);