http://www.cppblog.com/mydriverc/articles/33991.html 12345678910111213int main(){ string str = "0101"; bitset<32> b1(str); bitset<32> b2(5); cout << b2[3] << endl; cout << b2[2] << endl; cout << b2[1] << endl; cout << b2[0] << endl; return 0;} 转载于:https://www.cnblogs.com/helloweworld/p/3193917.html