bitset<N>& bitset<N>::operator^=(const bitset<N>& kqrRightSide);
#include <bitset>
#include <bitset>
#include <iostream>
int main()
{
using namespace std;
// Create two bitsets
bitset<4> qBits1(5);
bitset<4> qBits2(3);
cout << "bitset<4> #1: "<< qBits1 << endl;
cout << "bitset<4> #2: "<< qBits2 << endl;
// Take the bitwise exclusive-or of the two bitsets
cout << qBits1 << " ^ " << qBits2 << " = ";
qBits1 ^= qBits2;
cout << qBits1 << endl;
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.