/*
Description: bitset对象
*/#include<iostream>#include<bitset>usingnamespace std;intmain(){
bitset<30> a;unsignedlong b;
a.set(27);//第二十七位被设为1//0000000000000000000000001 --> 00100000000000000000000
b = b |(1UL<<27);//把第二十七位被设为1
a.reset(22);
b = b &~(1UL<<22);//等价于上面那句, 取反 再做位与运算 bool status;
status = a[27];
status = b &(1UL<<27);return0;}