摘要: 用 #defines 和 bit masks 操作。这是一个有极高可移植性#define BIT3 (0x1 << 3)static int a;void set_bit3(void){ //a = 0001a |= BIT3; // a = 1001}void clear_bit3(void){//~(1<<1)= 1111111111111101// ~(1<<2)= 1111111111111011a &= ~BIT3;} 阅读全文
posted @ 2012-08-23 15:19 ahuo 阅读(250) 评论(0) 推荐(0) 编辑