Mohsina_Shaikh's blog

By Mohsina_Shaikh, history, 20 months ago, In English
#include <bits/stdc++.h>

using namespace std;

int main()
{
    bitset<8> bt(3);
    bt[1]|=1;
    cout<<bt[1]<<"\n";
    return 0;
}

The program throws error. Why cannot we perform bitwise operations on bitsets like this.can anyone please explain.

  • Vote: I like it
  • -3
  • Vote: I do not like it

| Write comment?