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