In this exercise I am using Visual Studio 2019 and a modified version of the std_lib_facilities header found here.
Chapter 25 // Exercise 3
Initialise a 32-bit signed integer with the bit patterns and print the result:
- all zeros,
- all ones,
- alternating ones and zeros (starting with a leftmost zero),
- alternating zeros and ones (starting with a leftmost one),
- the 110011001100...pattern,
- the 001100110011...pattern,
- the pattern of all-one bytes and all-zero bytes starting with an all-one byte,
- the pattern of all-one bytes and all-zero bytes starting with an all-zero byte.
Repeat that exercise with a 32-bit unsigned integer.