http://www.cppblog.com/mydriverc/articles/33991.html

 

1
2
3
4
5
6
7
8
9
10
11
12
13

int 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;
}

相关文章:

  • 2022-01-26
  • 2022-12-23
  • 2021-11-14
  • 2022-01-02
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-16
  • 2021-06-07
  • 2021-10-13
  • 2021-05-25
相关资源
相似解决方案