Esempio n. 1
0
void clear_bit(char bit_array[], unsigned bit_number) {
  bit_array[character_offset(bit_number)] &= ~(1 << bit_offset(bit_number));
}
Esempio n. 2
0
void set_bit(char bit_array[], unsigned bit_number) {
  /*
  ** During the operator priority,shifting will be done before bitwise 'OR'.
  */
  bit_array[character_offset(bit_number)] |= 1 << bit_offset(bit_number);
}
Esempio n. 3
0
//测试特定位的值 
int test_bit( char bit_array[], unsigned bit_number )
	{
		return (bit_array[ character_offset( bit_number ) ]& 1 << bit_offset( bit_number )) != 0;
	}