bitset<N> operator|(const bitset<N>&, const bitset<N>&);
#include <bitset>
#include <bitset>
#include <iostream>
int main()
{
using namespace std;
// Create two bitsets of four bits
bitset<4> qBits1(6);
bitset<4> qBits2(3);
cout << "bitset<4> #1 : "<< qBits1 << endl;
cout << "bitset<4> #2 : "<< qBits2 << endl;
// Perform a bitwise or
bitset<4> qBitsOr = (qBits1 | qBits2);
cout << "The bitwise or is " << qBitsOr << endl;
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.