C语言
-
位运算具体应用、
-
位左为最高位、右为最低为、从右往左看、
-
#define a(c) (1<<(c)) int main() { int b; for ( b = 0; b < 20; b++) { printf("a(%d)=%d\n", b, a(b)); } }
-
#define a(c) (1<<(c)) int main() { enum b { b1 = a(0), b2 = a(1), b3 = a(2), b4 = a(3), b5 = a(4), b6 = a(5), b7 = a(6), b8 = a(7), }; unsigned int e = 0; //显示6 修改6 if (e & b6) { printf("显示6\n"); } else { printf("没显示\n"); e = e | b6; } if (e & b6) { printf("显示6\n"); } else { printf("没显示\n"); } }
-
-
常用于算法和密码学、