// ANSI C++ 11: tbs4.cpp // Built with: g++ -o tbs4 -std=c++11 -Wall -O3 tbs4.cpp #include #include #include #include #include int main(int argc, char* argv[]) { printf("0xFFFFFFFF = %u\n", 0xFFFFFFFF); printf("0xF0000000 = %u\n", 0xF0000000); // This is the OP's 32-bit value HIGH_BITS const uint32_t HIGH_BITS = 0xFFFFFFFF << 28; std::cout << "HIGH_BITS = " << HIGH_BITS << "\n"; // Display all 32 bits 1 2 3 // 12345678901234567890123456789012 const std::bitset<32> b1{"11110000000000000000000000000000"}; std::cout << "b1 = " << b1 << "\n"; const std::bitset<32> b2{HIGH_BITS}; std::cout << "b2 = " << b2 << "\n"; return 0; }