Bitset Bitwise Operations

Правка en1, от Mohsina_Shaikh, 2022-08-21 12:30:32
#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.

Теги bitset, bitwise, c++, help me

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Mohsina_Shaikh 2022-08-21 12:30:32 296 Initial revision (published)