1// constructing bitsets
2#include <iostream> // std::cout
3#include <string> // std::string
4#include <bitset> // std::bitset
5
6int main ()
7{
8 std::bitset<16> foo;
9 std::bitset<16> bar (0xfa2);
10 std::bitset<16> baz (std::string("0101111001"));
11
12 std::cout << "foo: " << foo << '\n';
13 std::cout << "bar: " << bar << '\n';
14 std::cout << "baz: " << baz << '\n';
15
16 return 0;
17}