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 and bitset<4> qBitsAnd = (qBits1 & qBits2); cout << "The bitwise and is " << qBitsAnd << endl; // Keep the window open cin.get(); return 0; }
© 20072024 XoaX.net LLC. All rights reserved.