bool bitset<N>::test(size_t qIndex) const;
#include <bitset>
#include <bitset>
#include <iostream>
int main()
{
using namespace std;
// Create a bitset
bitset<4> qBits(5);
cout << "bitset<4> : " << qBits << endl;
// Get the value at the index [2]
cout << "The bit value at [2] is " << qBits.test(2) << endl;
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.