bitset declaration c++ code example
Example: bitset declaration c++
// constructing bitsets
#include // std::cout
#include // std::string
#include // std::bitset
int main ()
{
std::bitset<16> foo;
std::bitset<16> bar (0xfa2);
std::bitset<16> baz (std::string("0101111001"));
std::cout << "foo: " << foo << '\n';
std::cout << "bar: " << bar << '\n';
std::cout << "baz: " << baz << '\n';
return 0;
}