For example; when I write 3, i am getting 00110011
6 -> 00110110
69 -> 00110110
I used int8_t, uint8_t, uint_least8_t etc. And I got same error. What is the reason of starting with 0011? I am using Visual Studio and Windows10.
#include <bitset>
#include <cstdint>
#include <iostream>
int main()
{
std::uint_fast8_t numb;
std::cout << "Please type an unsigned integer (0-255): ";
std::cin >> numb;
std::bitset<8> bits = static_cast<std::bitset<8>>(numb);
std::cout << bits << '\n';
}